Skip to content

Commit 3d42022

Browse files
ndoschekmartin-fleck-at
authored andcommitted
#96 Follow-up: Fix launch configs for test execution
Fix launch configurations for different test execution use cases (all, unit, current test file) Follow-up for #96
1 parent 39403ff commit 3d42022

4 files changed

Lines changed: 33 additions & 16 deletions

File tree

.vscode/launch.json

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,12 @@
4545
"request": "launch",
4646
"name": "Debug current test",
4747
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
48-
"args": ["--config", "${workspaceFolder}/configs/.mocharc.debug.json", "${file}"],
48+
"args": [
49+
"--config",
50+
"${workspaceFolder}/configs/.mocharc.debug.json",
51+
"--file",
52+
"${file}"
53+
],
4954
"console": "integratedTerminal",
5055
"internalConsoleOptions": "neverOpen",
5156
},
@@ -56,12 +61,7 @@
5661
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
5762
"args": [
5863
"--config",
59-
"${workspaceFolder}/configs/.mocharc.debug.json",
60-
"--no-timeouts",
61-
"--extension",
62-
"spec.ts",
63-
"${workspaceFolder}/packages/*/src",
64-
"--recursive",
64+
"${workspaceFolder}/configs/.mocharc.debug.all.json"
6565
],
6666
"env": {
6767
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"
@@ -76,14 +76,7 @@
7676
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
7777
"args": [
7878
"--config",
79-
"${workspaceFolder}/configs/.mocharc.debug.json",
80-
"--no-timeouts",
81-
"--extension",
82-
"spec.ts",
83-
"${workspaceFolder}/packages/*/src",
84-
"--recursive",
85-
"--ignore",
86-
"**/*integration.spec.ts"
79+
"${workspaceFolder}/configs/.mocharc.debug.unit.json"
8780
],
8881
"env": {
8982
"TS_NODE_PROJECT": "${workspaceFolder}/tsconfig.json"

configs/.mocharc.debug.all.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"$schema": "https://json.schemastore.org/mocharc",
3+
"require": ["ts-node/register", "reflect-metadata/Reflect", "ignore-styles"],
4+
"reporter": "spec",
5+
"color": true,
6+
"watch-files": ["*.ts", "*.tsx"],
7+
"timeout": 0,
8+
"extension": ["spec.ts"],
9+
"recursive": true,
10+
"spec": ["packages/**/src/**/*.spec.ts"]
11+
}

configs/.mocharc.debug.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@
44
"reporter": "spec",
55
"color": true,
66
"watch-files": ["*.ts", "*.tsx"],
7-
"timeout": 2000
7+
"timeout": 0,
8+
"extension": ["spec.ts"]
89
}

configs/.mocharc.debug.unit.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"$schema": "https://json.schemastore.org/mocharc",
3+
"require": ["ts-node/register", "reflect-metadata/Reflect", "ignore-styles"],
4+
"reporter": "spec",
5+
"color": true,
6+
"watch-files": ["*.ts", "*.tsx"],
7+
"timeout": 0,
8+
"extension": ["spec.ts"],
9+
"recursive": true,
10+
"spec": ["packages/**/src/**/*.spec.ts"],
11+
"ignore": ["packages/**/src/**/*integration.spec.ts"]
12+
}

0 commit comments

Comments
 (0)