Skip to content

Commit 9e5cb2e

Browse files
committed
Tests: TS: add back missing type checking
tsx does not run any type checking, hence a separate tsc step is needed .
1 parent 19f8bb4 commit 9e5cb2e

File tree

4 files changed

+16
-10
lines changed

4 files changed

+16
-10
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@
5858
}
5959
},
6060
"scripts": {
61-
"test-type-definitions": "tsx test/typescript.test.ts && tsx --tsconfig test/tsconfig.es5.json test/typescript.test.ts",
61+
"test-type-definitions": "tsc --project test/tsconfig.test.json && tsx test/typescript.test.ts",
62+
"test-type-definitions-es5": "tsc --project test/tsconfig.es5.json && tsx --tsconfig test/tsconfig.es5.json test/typescript.test.ts",
6263
"test-browser": "karma start karma.conf.cjs",
6364
"test-node": "ts-mocha -n loader=ts-node/esm ./test/node.test.ts ./test/common.test.ts",
6465
"lint": "eslint lib test",

test/tsconfig.es5.json

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/tsconfig.es5.test.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.test.json",
3+
"compilerOptions": {
4+
"target": "es5"
5+
}
6+
}

test/tsconfig.test.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"noEmit": true // code tested by tsx
5+
},
6+
"files": ["typescript.test.ts"]
7+
8+
}

0 commit comments

Comments
 (0)