add failing test for is.class bug
This commit is contained in:
parent
d22ab62991
commit
979eb763fc
2 changed files with 16 additions and 1 deletions
|
|
@ -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
15
test/test-node.js
Normal 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);
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue