Skip to content

Commit

Permalink
Experiment with vscode/test-cli package
Browse files Browse the repository at this point in the history
  • Loading branch information
fendor committed Oct 22, 2024
1 parent 4468a34 commit 3f113f8
Show file tree
Hide file tree
Showing 4 changed files with 223 additions and 10 deletions.
15 changes: 15 additions & 0 deletions .vscode-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const { defineConfig } = require('@vscode/test-cli');

module.exports = defineConfig([
{
label: 'integration-tests',
files: 'out/test/**/*.test.js',
version: 'stable',
workspaceFolder: './test-workspace',
installExtensions: ['justusadam.language-haskell'],
mocha: {
timeout: 120 * 1000 // 2 minute timeout
}
}
// you can specify additional test configurations, too
]);
3 changes: 1 addition & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"request": "launch",
"runtimeExecutable": "${execPath}",
"args": ["--extensionDevelopmentPath=${workspaceRoot}"],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/src/**/*.js"],
"preLaunchTask": "npm: webpack"
Expand All @@ -18,8 +17,8 @@
"type": "extensionHost",
"request": "launch",
"runtimeExecutable": "${execPath}",
"testConfiguration": "${workspaceFolder}/.vscode-test.js",
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test"],
"stopOnEntry": false,
"sourceMaps": true,
"outFiles": ["${workspaceRoot}/out/test/**/*.js"],
"preLaunchTask": "npm: pretest"
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@
"push-tag": "git tag -a $npm_package_version -m \"Version $npm_package_version\" && git push origin $npm_package_version",
"pretest": "tsc --alwaysStrict -p ./",
"format": "prettier . --write",
"test": "node ./out/test/runTest.js"
"test": "vscode-test"
},
"husky": {
"hooks": {
Expand All @@ -1309,6 +1309,7 @@
"@types/which": "^3.0.4",
"@typescript-eslint/eslint-plugin": "^7.18.0",
"@typescript-eslint/parser": "^7.18.0",
"@vscode/test-cli": "^0.0.10",
"@vscode/test-electron": "^2.4.1",
"eslint": "^8.57.0",
"eslint-webpack-plugin": "^4.2.0",
Expand Down
Loading

0 comments on commit 3f113f8

Please sign in to comment.