Skip to content

Commit c4d9ef2

Browse files
committed
Use correct tsconfig.json in pure tests
This will change the pure tests Mocha setup to actually use the `tsconfig.json` located in the `test` directory. Before, it was using the root-level `tsconfig.json`. To ensure we are still using mostly the same settings, this will extend the `test/tsconfig.json` from the root-level `tsconfig.json`.
1 parent a9e49f2 commit c4d9ef2

File tree

5 files changed

+20
-9
lines changed

5 files changed

+20
-9
lines changed

.vscode/launch.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,8 @@
4444
"bdd",
4545
"--colors",
4646
"--diff",
47-
"-r",
48-
"ts-node/register",
49-
"-r",
50-
"test/mocha.setup.js",
47+
"--config",
48+
".mocharc.json",
5149
"test/pure-tests/**/*.ts"
5250
],
5351
"stopOnEntry": false,

extensions/ql-vscode/.mocharc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"exit": true,
3+
"require": [
4+
"test/mocha.setup.js"
5+
]
6+
}

extensions/ql-vscode/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1248,7 +1248,7 @@
12481248
"watch:extension": "tsc --watch",
12491249
"watch:webpack": "gulp watchView",
12501250
"test": "npm-run-all -p test:*",
1251-
"test:unit": "mocha --exit -r ts-node/register -r test/mocha.setup.js test/pure-tests/**/*.ts",
1251+
"test:unit": "mocha --config .mocharc.json test/pure-tests/**/*.ts",
12521252
"test:view": "jest",
12531253
"preintegration": "rm -rf ./out/vscode-tests && gulp",
12541254
"integration": "node ./out/vscode-tests/run-integration-tests.js no-workspace,minimal-workspace",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
const path = require('path');
2+
3+
require('ts-node').register({
4+
project: path.resolve(__dirname, 'tsconfig.json')
5+
})
6+
17
process.env.TZ = 'UTC';
28
process.env.LANG = 'en-US';
Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
{
2-
"include": [
3-
"**/*.ts"
4-
],
2+
"extends": "../tsconfig.json",
3+
"include": ["**/*.ts"],
4+
"exclude": [],
55
"compilerOptions": {
6-
"noEmit": true
6+
"noEmit": true,
7+
"resolveJsonModule": true
78
}
89
}

0 commit comments

Comments
 (0)