Skip to content

Commit

Permalink
VS Code integration coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
jpogran committed Nov 21, 2024
1 parent d430a8e commit 6d2163c
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 14 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,19 @@ jobs:
- name: Run Tests
run: npm test
if: runner.os != 'Linux'

coverage:
runs-on: ubuntu-latest
timeout-minutes: 3
steps:
- name: Checkout Repo
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: actions/setup-node@39370e3970a6d050c480ffad4ff0ed4d3fdee5af # v4.1.0
with:
node-version-file: '.nvmrc'
cache: npm
- name: npm install
run: npm ci
- name: format
# Coverage summary printed to console and in coverage/coverage-summary.json
run: npm run test:coverage
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ npm-debug.log
dist
out
syntaxes
.coverage
coverage
17 changes: 3 additions & 14 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,16 @@ const configs = testSuiteFolderNames.map((folderName) => ({
color: true,
timeout: 100000,
require: ['./out/test/mockSetup.js'], // mocks are shared for all test suites
// reporter: path.join(__dirname, '.mocha-reporter.js'),
reporter: 'json', // "lcov" also generates HTML
reporterOptions: {
jsonReporterOptions: {
output: '.integration-tests.json',
},
},
},
}));

// const config = defineConfig(configs);
const config = defineConfig({
tests: configs,
coverage: {
includeAll: true,
exclude: [`./out`],
reporter: 'json', // "lcov" also generates HTML
reporterOptions: {
jsonReporterOptions: {
output: '.integration-tests.json',
},
},
exclude: ['**/src/test', '**/dist', '**/*.test.[tj]s', '**/*.ts'],
reporter: ['text-summary', 'json-summary'],
},
});

Expand Down
2 changes: 2 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
.vscode-test.mjs
.vscodeignore
.wdio-vscode-service
.coverage
coverage
**/__mocks__
build/
DEVELOPMENT.md
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -947,6 +947,7 @@
"package": "vsce package",
"pretest": "npm run compile:tests && npm run compile && npm run lint",
"test": "vscode-test",
"test:coverage": "vscode-test --coverage",
"wdio": "npm run compile && wdio run ./src/test/e2e/wdio.conf.ts",
"lint": "eslint",
"format": "prettier --write .",
Expand Down

0 comments on commit 6d2163c

Please sign in to comment.