add failing test for is.class bug

This commit is contained in:
Tim Griesser 2025-10-31 09:35:47 -04:00
parent d22ab62991
commit 979eb763fc
2 changed files with 16 additions and 1 deletions

View file

@ -21,7 +21,7 @@
},
"scripts": {
"build": "del distribution && tsc",
"test": "tsc --noEmit && xo && ava",
"test": "tsc --noEmit && xo && ava && node test/test-node.js",
"prepare": "npm run build"
},
"files": [

15
test/test-node.js Normal file
View file

@ -0,0 +1,15 @@
import assert from 'node:assert';
import {test} from 'node:test';
import is, {assert as isAssert} from '../distribution/index.js';
// Note: this test is separate from the rest of the tests, as it requires
// preserving whitespace. The tsimp modifies the source and does not
// properly preserve the intended test case
test('is.class', () => {
const minifiedClass = class{}; // eslint-disable-line keyword-spacing
assert.ok(is.class(minifiedClass));
assert.doesNotThrow(() => {
isAssert.class(minifiedClass);
});
});