Skip to content

Commit

Permalink
Switch to new method for executing extension tests
Browse files Browse the repository at this point in the history
  • Loading branch information
adiessl committed Feb 27, 2024
1 parent 8301ab9 commit 148b0c8
Show file tree
Hide file tree
Showing 10 changed files with 2,323 additions and 127 deletions.
5 changes: 5 additions & 0 deletions .vscode-test.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { defineConfig } from '@vscode/test-cli';

export default defineConfig({
files: 'out/test/**/*.test.js',
});
5 changes: 3 additions & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"dbaeumer.vscode-eslint"
"dbaeumer.vscode-eslint",
"ms-vscode.extension-test-runner"
]
}
}
13 changes: 0 additions & 13 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,6 @@
"${workspaceFolder}/out/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
},
{
"name": "Extension Tests",
"type": "extensionHost",
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}",
"--extensionTestsPath=${workspaceFolder}/out/test/index"
],
"outFiles": [
"${workspaceFolder}/out/test/**/*.js"
],
"preLaunchTask": "${defaultBuildTask}"
}
]
}
1 change: 1 addition & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ vsc-extension-quickstart.md
**/.eslintrc.json
**/*.map
**/*.ts
**/.vscode-test.*
9 changes: 3 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -176,23 +176,20 @@
"watch": "tsc -watch -p ./",
"pretest": "yarn run compile && yarn run lint",
"lint": "eslint src --ext ts",
"test": "node ./out/test/runTest.js"
"test": "vscode-test"
},
"dependencies": {
"typescript": "^5.3.3"
},
"devDependencies": {
"@types/chai": "^4.3.12",
"@types/glob": "^8.1.0",
"@types/mocha": "^10.0.6",
"@types/node": "^20.11.20",
"@types/vscode": "^1.86.0",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"@vscode/test-cli": "^0.0.6",
"@vscode/test-electron": "^2.3.9",
"chai": "^4.4.1",
"eslint": "^8.57.0",
"glob": "^8.0.3",
"mocha": "^10.3.0"
"eslint": "^8.57.0"
}
}
38 changes: 0 additions & 38 deletions src/test/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions src/test/integration/extension.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ suite('integration', function() {
});

suite('diagnostics should be available', function() {
this.timeout(10000);

suiteSetup(async () => await testUtils.createTextDocument('setup suite', undefined));

teardown(async () => await vscode.commands.executeCommand('workbench.action.closeActiveEditor'));
Expand Down
27 changes: 0 additions & 27 deletions src/test/runTest.ts

This file was deleted.

Loading

0 comments on commit 148b0c8

Please sign in to comment.