Remove VSCode dependency from Mocha test harness. · WebFreak001/code-debug@558cea8 · GitHub
Skip to content

Commit 558cea8

Browse files
committed
Remove VSCode dependency from Mocha test harness.
There is no need for VSCode to be used in order to run the current Mocha tests. The debug adapter doesn't have a dependency on VSCode itself, so the harness is reworked to be a standalone Mocha testing harness. In addition to the changes to the testing harness, code coverage is now also collected. Additional tasks have been added to both run the test harness as well as collect the coverage metrics. Furthermore, coverage metrics are also reported to CodeCov. Shields have also been added to the README covering continuous integration and code coverage. Also the VS Marketplace and Open VSX badges were also added.
1 parent db00740 commit 558cea8

15 files changed

Lines changed: 3018 additions & 471 deletions

‎.github/workflows/unit_test.yml‎

Lines changed: 14 additions & 4 deletions

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
out
2+
coverage
23
node_modules
34
*.vsix
5+
.nyc_output
46
.vscode-test

‎.mocharc.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
color: true
2+
recursive: true
3+
require: "ts-node/register"
4+
spec:
5+
- "**/*.test.ts"
6+
ui: "tdd"

‎.nycrc.yml‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
extends: "@istanbuljs/nyc-config-typescript"
2+
all: true
3+
reporter:
4+
- text
5+
- lcovonly

‎.vscode/settings.json‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@
44
"files.exclude": {
55
"out": false // set this to true to hide the "out" folder with the compiled JS files
66
},
7+
"mochaExplorer.timeout": 999999, // Set large so debugging doesn't trigger mocha timeout
78
"search.exclude": {
89
"out": true // set this to false to include "out" folder in search results
910
},
11+
"testExplorer.useNativeTesting": true, // Use VSCode Native Test Explorer
1012
"typescript.tsdk": "./node_modules/typescript/lib" // we want to use the TS server from our node_modules folder to control its version
1113
}

‎.vscode/tasks.json‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,23 @@
4646
"group": "build",
4747
"args": ["run", "lint-and-fix"],
4848
"problemMatcher": "$eslint-compact"
49+
},
50+
// Ctrl + Shift + P (Command Palette), then select "Tasks: Run Test Task" and select "npm:test"
51+
{
52+
"label": "npm:test",
53+
"detail": "Run Project Tests",
54+
"type": "shell",
55+
"command": "npm",
56+
"group": "test",
57+
"args": ["test"]
58+
},
59+
{
60+
"label": "npm:coverage",
61+
"detail": "Run Test Coverage Report",
62+
"type": "shell",
63+
"command": "npm",
64+
"group": "test",
65+
"args": ["run", "coverage"]
4966
}
5067
]
5168
}

‎README.md‎

Lines changed: 5 additions & 0 deletions

0 commit comments

Comments
 (0)