Skip to content

Commit

Permalink
Set up testing branch, install testing dependencies, set up test dire…
Browse files Browse the repository at this point in the history
…ctory, configure test runner (runTest.ts only)
  • Loading branch information
bensonhpcheng committed Sep 16, 2024
1 parent 26117ea commit c641538
Show file tree
Hide file tree
Showing 7 changed files with 386 additions and 51 deletions.
4 changes: 2 additions & 2 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"parserOptions": {
"ecmaVersion": 2022,
"sourceType": "module",
"project": "./tsconfig.json"
"project": ["./tsconfig.json", "./tsconfig.test.json"]
},
"env": {
"browser": true,
Expand All @@ -30,7 +30,7 @@
"semi": "off",
"prettier/prettier": "warn"
},
"ignorePatterns": ["dist", "**/*.d.ts", "src/logic/aria-standards"],
"ignorePatterns": ["dist", "**/*.d.ts", "src/logic/aria-standards", "test/**/*", "webpack.config.js"],
"overrides": [
{
"files": ["webpack.config.js"],
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,18 +92,23 @@
"@babel/preset-env": "^7.24.7",
"@babel/preset-react": "^7.24.7",
"@babel/preset-typescript": "^7.24.7",
"@types/chai": "^4.3.19",
"@types/chart.js": "^2.9.41",
"@types/mocha": "^10.0.8",
"@types/node": "20.x",
"@types/vscode": "^1.91.0",
"@vscode/test-cli": "^0.0.9",
"@vscode/test-electron": "^2.4.1",
"babel-loader": "^9.1.3",
"chai": "^5.1.1",
"chart.js": "^4.4.3",
"clean-webpack-plugin": "^4.0.0",
"copy-webpack-plugin": "^12.0.2",
"css-loader": "^7.1.2",
"eslint": "8.56.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"mocha": "^10.7.3",
"prettier": "^3.3.3",
"style-loader": "^4.0.0",
"ts-loader": "^9.5.1",
Expand Down
404 changes: 355 additions & 49 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions test/runTest.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as path from 'path';
import { runTests } from '@vscode/test-electron';

async function main() {
try {
// The folder containing the Extension Manifest package.json
const extensionDevelopmentPath = path.resolve(__dirname, '../');

// The path to the extension test runner script
const extensionTestsPath = path.resolve(__dirname, './suite/index');

// Download VS Code, unzip it, and run the integration test
await runTests({ extensionDevelopmentPath, extensionTestsPath });
} catch (err) {
console.error('Failed to run tests');
process.exit(1);
}
}

main();
Empty file added test/suite/extensions.test.ts
Empty file.
Empty file added test/suite/index.ts
Empty file.
4 changes: 4 additions & 0 deletions tsconfig.test.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": "./tsconfig.json",
"include": ["test"]
}

0 comments on commit c641538

Please sign in to comment.