generator-code 1.8.0 → 1.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/generators/app/dependencyVersions/package.json +13 -11
  2. package/generators/app/generate-command-js.js +1 -0
  3. package/generators/app/generate-command-ts.js +1 -0
  4. package/generators/app/generate-notebook-renderer.js +1 -0
  5. package/generators/app/templates/ext-command-js/.vscode-test.mjs +5 -0
  6. package/generators/app/templates/ext-command-js/.vscodeignore +1 -0
  7. package/generators/app/templates/ext-command-js/package.json +2 -3
  8. package/generators/app/templates/ext-command-js/vsc-extension-quickstart.md +5 -5
  9. package/generators/app/templates/ext-command-js/vscode/extensions.json +3 -2
  10. package/generators/app/templates/ext-command-js/vscode/launch.json +0 -9
  11. package/generators/app/templates/ext-command-ts/.vscode-test.mjs +5 -0
  12. package/generators/app/templates/ext-command-ts/.vscodeignore +1 -0
  13. package/generators/app/templates/ext-command-ts/package.json +2 -3
  14. package/generators/app/templates/ext-command-ts/vsc-extension-quickstart.md +5 -4
  15. package/generators/app/templates/ext-command-ts/vscode/extensions.json +2 -1
  16. package/generators/app/templates/ext-command-ts/vscode/launch.json +0 -13
  17. package/generators/app/templates/ext-command-ts/vscode-webpack/.vscodeignore +1 -0
  18. package/generators/app/templates/ext-command-ts/vscode-webpack/package.json +2 -3
  19. package/generators/app/templates/ext-command-ts/vscode-webpack/vsc-extension-quickstart.md +6 -5
  20. package/generators/app/templates/ext-command-ts/vscode-webpack/vscode/extensions.json +1 -1
  21. package/generators/app/templates/ext-command-ts/vscode-webpack/vscode/launch.json +0 -14
  22. package/generators/app/templates/ext-command-web/.vscodeignore +1 -0
  23. package/generators/app/templates/ext-command-web/package.json +1 -0
  24. package/generators/app/templates/ext-command-web/vsc-extension-quickstart.md +1 -1
  25. package/generators/app/templates/ext-notebook-renderer/.vscode-test.mjs +5 -0
  26. package/generators/app/templates/ext-notebook-renderer/.vscodeignore +1 -0
  27. package/generators/app/templates/ext-notebook-renderer/package.json +2 -1
  28. package/generators/app/templates/ext-notebook-renderer/vscode/extensions.json +1 -1
  29. package/generators/app/templates/ext-notebook-renderer/vscode/launch.json +0 -13
  30. package/package.json +2 -2
  31. package/generators/app/templates/ext-command-js/test/runTest.js +0 -23
  32. package/generators/app/templates/ext-command-js/test/suite/index.js +0 -36
  33. package/generators/app/templates/ext-command-ts/src/test/runTest.ts +0 -23
  34. package/generators/app/templates/ext-command-ts/src/test/suite/index.ts +0 -32
  35. package/generators/app/templates/ext-notebook-renderer/src/test/runTest.ts +0 -23
  36. package/generators/app/templates/ext-notebook-renderer/src/test/suite/index.ts +0 -32
  37. /package/generators/app/templates/ext-command-js/test/{suite/extension.test.js → extension.test.js} +0 -0
  38. /package/generators/app/templates/ext-command-ts/src/test/{suite/extension.test.ts → extension.test.ts} +0 -0
  39. /package/generators/app/templates/ext-notebook-renderer/src/test/{suite/extension.test.ts → extension.test.ts} +0 -0
@@ -4,23 +4,25 @@
4
4
  "version": "0.0.0",
5
5
  "private": true,
6
6
  "dependencies": {
7
- "@types/mocha": "^10.0.3",
7
+ "@types/mocha": "^10.0.6",
8
8
  "@types/node": "18.x",
9
- "@typescript-eslint/eslint-plugin": "^6.9.0",
10
- "@typescript-eslint/parser": "^6.9.0",
11
- "eslint": "^8.52.0",
9
+ "@types/assert": "^1.5.10",
10
+ "@typescript-eslint/eslint-plugin": "^6.15.0",
11
+ "@typescript-eslint/parser": "^6.15.0",
12
+ "eslint": "^8.56.0",
12
13
  "glob": "^10.3.10",
13
14
  "mocha": "^10.2.0",
14
- "typescript": "^5.2.2",
15
- "@vscode/test-electron": "^2.3.6",
16
- "@vscode/test-web": "^0.0.48",
17
- "@types/webpack-env": "^1.18.3",
18
- "@types/vscode-notebook-renderer": "^1.72.2",
15
+ "typescript": "^5.3.3",
16
+ "@vscode/test-cli": "^0.0.4",
17
+ "@vscode/test-electron": "^2.3.8",
18
+ "@vscode/test-web": "^0.0.50",
19
+ "@types/webpack-env": "^1.18.4",
20
+ "@types/vscode-notebook-renderer": "^1.72.3",
19
21
  "concurrently": "^8.2.2",
20
22
  "css-loader": "^6.8.1",
21
- "fork-ts-checker-webpack-plugin": "^9.0.0",
23
+ "fork-ts-checker-webpack-plugin": "^9.0.2",
22
24
  "style-loader": "^3.3.3",
23
- "ts-loader": "^9.5.0",
25
+ "ts-loader": "^9.5.1",
24
26
  "vscode-dts": "^0.3.3",
25
27
  "vscode-notebook-error-overlay": "^1.0.1",
26
28
  "webpack": "^5.89.0",
@@ -52,6 +52,7 @@ export default {
52
52
 
53
53
  generator.fs.copyTpl(generator.templatePath('extension.js'), generator.destinationPath('extension.js'), extensionConfig);
54
54
  generator.fs.copyTpl(generator.templatePath('package.json'), generator.destinationPath('package.json'), extensionConfig);
55
+ generator.fs.copy(generator.templatePath('.vscode-test.mjs'), generator.destinationPath('.vscode-test.mjs'));
55
56
  generator.fs.copyTpl(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'), extensionConfig);
56
57
 
57
58
  if (extensionConfig.pkgManager === 'yarn') {
@@ -52,6 +52,7 @@ export default {
52
52
  generator.fs.copyTpl(generator.templatePath('CHANGELOG.md'), generator.destinationPath('CHANGELOG.md'), extensionConfig);
53
53
  generator.fs.copyTpl(generator.templatePath('src/extension.ts'), generator.destinationPath('src/extension.ts'), extensionConfig);
54
54
  generator.fs.copy(generator.templatePath('src/test'), generator.destinationPath('src/test'));
55
+ generator.fs.copy(generator.templatePath('.vscode-test.mjs'), generator.destinationPath('.vscode-test.mjs'));
55
56
  generator.fs.copy(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'));
56
57
 
57
58
  if (extensionConfig.pkgManager === 'yarn') {
@@ -35,6 +35,7 @@ export default {
35
35
  generator.fs.copy(generator.templatePath('.vscodeignore'), generator.destinationPath('.vscodeignore'));
36
36
  generator.fs.copy(generator.templatePath('webpack.config.js'), generator.destinationPath('webpack.config.js'));
37
37
  generator.fs.copy(generator.templatePath('.eslintrc.json'), generator.destinationPath('.eslintrc.json'));
38
+ generator.fs.copy(generator.templatePath('.vscode-test.mjs'), generator.destinationPath('.vscode-test.mjs'));
38
39
 
39
40
  generator.fs.copyTpl(generator.templatePath('package.json'), generator.destinationPath('package.json'), extensionConfig);
40
41
  generator.fs.copyTpl(generator.templatePath('README.md'), generator.destinationPath('README.md'), extensionConfig);
@@ -0,0 +1,5 @@
1
+ import { defineConfig } from '@vscode/test-cli';
2
+
3
+ export default defineConfig({
4
+ files: 'test/**/*.test.js',
5
+ });
@@ -7,3 +7,4 @@ vsc-extension-quickstart.md
7
7
  **/jsconfig.json
8
8
  **/*.map
9
9
  **/.eslintrc.json
10
+ **/.vscode-test.*
@@ -20,16 +20,15 @@
20
20
  "scripts": {
21
21
  "lint": "eslint .",
22
22
  "pretest": "<%= pkgManager %> run lint",
23
- "test": "node ./test/runTest.js"
23
+ "test": "vscode-test"
24
24
  },
25
25
  "devDependencies": {
26
26
  <%- dep("@types/vscode") %>,
27
27
  <%- dep("@types/mocha") %>,
28
28
  <%- dep("@types/node") %>,
29
29
  <%- dep("eslint") %>,
30
- <%- dep("glob") %>,
31
- <%- dep("mocha") %>,
32
30
  <%- dep("typescript") %>,
31
+ <%- dep("@vscode/test-cli") %>,
33
32
  <%- dep("@vscode/test-electron") %>
34
33
  }
35
34
  }
@@ -27,11 +27,11 @@
27
27
 
28
28
  ## Run tests
29
29
 
30
- * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
31
- * Press `F5` to run the tests in a new window with your extension loaded.
32
- * See the output of the test result in the debug console.
33
- * Make changes to `src/test/suite/extension.test.js` or create new test files inside the `test/suite` folder.
34
- * The provided test runner will only consider files matching the name pattern `**.test.ts`.
30
+ * Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
31
+ * Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A`
32
+ * See the output of the test result in the Test Results view.
33
+ * Make changes to `test/extension.test.js` or create new test files inside the `test` folder.
34
+ * The provided test runner will only consider files matching the name pattern `**.test.js`.
35
35
  * You can create folders inside the `test` folder to structure your tests any way you want.
36
36
 
37
37
  ## Go further
@@ -2,6 +2,7 @@
2
2
  // See https://go.microsoft.com/fwlink/?LinkId=733558
3
3
  // for the documentation about the extensions.json format
4
4
  "recommendations": [
5
- "dbaeumer.vscode-eslint"
5
+ "dbaeumer.vscode-eslint",
6
+ "ms-vscode.extension-test-runner"
6
7
  ]
7
- }
8
+ }
@@ -12,15 +12,6 @@
12
12
  "args": [
13
13
  "--extensionDevelopmentPath=${workspaceFolder}"
14
14
  ]
15
- },
16
- {
17
- "name": "Extension Tests",
18
- "type": "extensionHost",
19
- "request": "launch",
20
- "args": [
21
- "--extensionDevelopmentPath=${workspaceFolder}",
22
- "--extensionTestsPath=${workspaceFolder}/test/suite/index"
23
- ]
24
15
  }
25
16
  ]
26
17
  }
@@ -0,0 +1,5 @@
1
+ import { defineConfig } from '@vscode/test-cli';
2
+
3
+ export default defineConfig({
4
+ files: 'out/test/**/*.test.js',
5
+ });
@@ -8,3 +8,4 @@ vsc-extension-quickstart.md
8
8
  **/.eslintrc.json
9
9
  **/*.map
10
10
  **/*.ts
11
+ **/.vscode-test.*
@@ -26,7 +26,7 @@
26
26
  "watch": "tsc -watch -p ./",
27
27
  "pretest": "<%= pkgManager %> run compile && <%= pkgManager %> run lint",
28
28
  "lint": "eslint src --ext ts",
29
- "test": "node ./out/test/runTest.js"<% if (insiders) { %>,
29
+ "test": "vscode-test"<% if (insiders) { %>,
30
30
  "update-proposed-api": "vscode-dts dev"<% } %>
31
31
  },
32
32
  "devDependencies": {
@@ -36,9 +36,8 @@
36
36
  <%- dep("@typescript-eslint/eslint-plugin") %>,
37
37
  <%- dep("@typescript-eslint/parser") %>,
38
38
  <%- dep("eslint") %>,
39
- <%- dep("glob") %>,
40
- <%- dep("mocha") %>,
41
39
  <%- dep("typescript") %>,
40
+ <%- dep("@vscode/test-cli") %>,
42
41
  <%- dep("@vscode/test-electron") %><% if (insiders) { %>,
43
42
  <%- dep("vscode-dts") %><% } %>
44
43
  }
@@ -27,10 +27,11 @@
27
27
 
28
28
  ## Run tests
29
29
 
30
- * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
31
- * Press `F5` to run the tests in a new window with your extension loaded.
32
- * See the output of the test result in the debug console.
33
- * Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder.
30
+ * Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
31
+ * Run the "watch" task via the **Tasks: Run Task** command. Make sure this is running, or tests might not be discovered.
32
+ * Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A`
33
+ * See the output of the test result in the Test Results view.
34
+ * Make changes to `src/test/extension.test.ts` or create new test files inside the `test` folder.
34
35
  * The provided test runner will only consider files matching the name pattern `**.test.ts`.
35
36
  * You can create folders inside the `test` folder to structure your tests any way you want.
36
37
 
@@ -2,6 +2,7 @@
2
2
  // See http://go.microsoft.com/fwlink/?LinkId=827846
3
3
  // for the documentation about the extensions.json format
4
4
  "recommendations": [
5
- "dbaeumer.vscode-eslint"
5
+ "dbaeumer.vscode-eslint",
6
+ "ms-vscode.extension-test-runner"
6
7
  ]
7
8
  }
@@ -16,19 +16,6 @@
16
16
  "${workspaceFolder}/out/**/*.js"
17
17
  ],
18
18
  "preLaunchTask": "${defaultBuildTask}"
19
- },
20
- {
21
- "name": "Extension Tests",
22
- "type": "extensionHost",
23
- "request": "launch",
24
- "args": [
25
- "--extensionDevelopmentPath=${workspaceFolder}",
26
- "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27
- ],
28
- "outFiles": [
29
- "${workspaceFolder}/out/test/**/*.js"
30
- ],
31
- "preLaunchTask": "${defaultBuildTask}"
32
19
  }
33
20
  ]
34
21
  }
@@ -11,3 +11,4 @@ vsc-extension-quickstart.md
11
11
  **/.eslintrc.json
12
12
  **/*.map
13
13
  **/*.ts
14
+ **/.vscode-test.*
@@ -29,7 +29,7 @@
29
29
  "watch-tests": "tsc -p . -w --outDir out",
30
30
  "pretest": "<%= pkgManager %> run compile-tests && <%= pkgManager %> run compile && <%= pkgManager %> run lint",
31
31
  "lint": "eslint src --ext ts",
32
- "test": "node ./out/test/runTest.js"<% if (insiders) { %>,
32
+ "test": "vscode-test"<% if (insiders) { %>,
33
33
  "update-proposed-api": "vscode-dts dev"<% } %>
34
34
  },
35
35
  "devDependencies": {
@@ -39,12 +39,11 @@
39
39
  <%- dep("@typescript-eslint/eslint-plugin") %>,
40
40
  <%- dep("@typescript-eslint/parser") %>,
41
41
  <%- dep("eslint") %>,
42
- <%- dep("glob") %>,
43
- <%- dep("mocha") %>,
44
42
  <%- dep("typescript") %>,
45
43
  <%- dep("ts-loader") %>,
46
44
  <%- dep("webpack") %>,
47
45
  <%- dep("webpack-cli") %>,
46
+ <%- dep("@vscode/test-cli") %>,
48
47
  <%- dep("@vscode/test-electron") %><% if (insiders) { %>,
49
48
  <%- dep("vscode-dts") %><% } %>
50
49
  }
@@ -11,7 +11,7 @@
11
11
 
12
12
  ## Setup
13
13
 
14
- * install the recommended extensions (amodio.tsl-problem-matcher and dbaeumer.vscode-eslint)
14
+ * install the recommended extensions (amodio.tsl-problem-matcher, ms-vscode.extension-test-runner, and dbaeumer.vscode-eslint)
15
15
 
16
16
 
17
17
  ## Get up and running straight away
@@ -33,10 +33,11 @@
33
33
 
34
34
  ## Run tests
35
35
 
36
- * Open the debug viewlet (`Ctrl+Shift+D` or `Cmd+Shift+D` on Mac) and from the launch configuration dropdown pick `Extension Tests`.
37
- * Press `F5` to run the tests in a new window with your extension loaded.
38
- * See the output of the test result in the debug console.
39
- * Make changes to `src/test/suite/extension.test.ts` or create new test files inside the `test/suite` folder.
36
+ * Install the [Extension Test Runner](https://marketplace.visualstudio.com/items?itemName=ms-vscode.extension-test-runner)
37
+ * Run the "watch" task via the **Tasks: Run Task** command. Make sure this is running, or tests might not be discovered.
38
+ * Open the Testing view from the activity bar and click the Run Test" button, or use the hotkey `Ctrl/Cmd + ; A`
39
+ * See the output of the test result in the Test Results view.
40
+ * Make changes to `src/test/extension.test.ts` or create new test files inside the `test` folder.
40
41
  * The provided test runner will only consider files matching the name pattern `**.test.ts`.
41
42
  * You can create folders inside the `test` folder to structure your tests any way you want.
42
43
 
@@ -1,5 +1,5 @@
1
1
  {
2
2
  // See http://go.microsoft.com/fwlink/?LinkId=827846
3
3
  // for the documentation about the extensions.json format
4
- "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
4
+ "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
5
5
  }
@@ -16,20 +16,6 @@
16
16
  "${workspaceFolder}/dist/**/*.js"
17
17
  ],
18
18
  "preLaunchTask": "${defaultBuildTask}"
19
- },
20
- {
21
- "name": "Extension Tests",
22
- "type": "extensionHost",
23
- "request": "launch",
24
- "args": [
25
- "--extensionDevelopmentPath=${workspaceFolder}",
26
- "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
27
- ],
28
- "outFiles": [
29
- "${workspaceFolder}/out/**/*.js",
30
- "${workspaceFolder}/dist/**/*.js"
31
- ],
32
- "preLaunchTask": "tasks: watch-tests"
33
19
  }
34
20
  ]
35
21
  }
@@ -11,3 +11,4 @@ webpack.config.js
11
11
  **/.eslintrc.json
12
12
  **/*.map
13
13
  **/*.ts
14
+ **/.vscode-test.*
@@ -32,6 +32,7 @@
32
32
  "devDependencies": {
33
33
  <%- dep("@types/vscode") %>,
34
34
  <%- dep("@types/mocha") %>,
35
+ <%- dep("@types/assert") %>,
35
36
  <%- dep("eslint") %>,
36
37
  <%- dep("@typescript-eslint/eslint-plugin") %>,
37
38
  <%- dep("@typescript-eslint/parser") %>,
@@ -9,7 +9,7 @@
9
9
 
10
10
  ## Setup
11
11
 
12
- * install the recommended extensions (amodio.tsl-problem-matcher and dbaeumer.vscode-eslint)
12
+ * install the recommended extensions (amodio.tsl-problem-matcher, ms-vscode.extension-test-runner, and dbaeumer.vscode-eslint)
13
13
 
14
14
  ## Get up and running the Web Extension
15
15
 
@@ -0,0 +1,5 @@
1
+ import { defineConfig } from '@vscode/test-cli';
2
+
3
+ export default defineConfig({
4
+ files: 'out/test/**/*.test.js',
5
+ });
@@ -10,3 +10,4 @@ vsc-extension-quickstart.md
10
10
  **/*.map
11
11
  **/*.ts
12
12
  **/*.tsbuildinfo
13
+ **/.vscode-test.*
@@ -31,7 +31,7 @@
31
31
  "lint": "eslint src --ext ts",
32
32
  "watch": "webpack --mode development --watch",
33
33
  "pretest": "webpack --mode development && <%= pkgManager %> run lint",
34
- "test": "node ./out/test/runTest.js"
34
+ "test": "vscode-test"
35
35
  },
36
36
  "devDependencies": {
37
37
  <%- dep("@types/mocha") %>,
@@ -50,6 +50,7 @@
50
50
  <%- dep("ts-loader") %>,
51
51
  <%- dep("typescript") %>,
52
52
  <%- dep("vscode-notebook-error-overlay") %>,
53
+ <%- dep("@vscode/test-cli") %>,
53
54
  <%- dep("@vscode/test-electron") %>,
54
55
  <%- dep("util") %>,
55
56
  <%- dep("webpack") %>,
@@ -1,5 +1,5 @@
1
1
  {
2
2
  // See http://go.microsoft.com/fwlink/?LinkId=827846
3
3
  // for the documentation about the extensions.json format
4
- "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher"]
4
+ "recommendations": ["dbaeumer.vscode-eslint", "amodio.tsl-problem-matcher", "ms-vscode.extension-test-runner"]
5
5
  }
@@ -32,19 +32,6 @@
32
32
  ],
33
33
  "debugWebviews": true,
34
34
  "preLaunchTask": "npm: watch"
35
- },
36
- {
37
- "name": "Extension Tests",
38
- "type": "extensionHost",
39
- "request": "launch",
40
- "args": [
41
- "--extensionDevelopmentPath=${workspaceFolder}",
42
- "--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
43
- ],
44
- "outFiles": [
45
- "${workspaceFolder}/out/test/**/*.js"
46
- ],
47
- "preLaunchTask": "${defaultBuildTask}"
48
35
  }
49
36
  ]
50
37
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "generator-code",
3
- "version": "1.8.0",
3
+ "version": "1.8.2",
4
4
  "description": "Yeoman generator for Visual Studio Code extensions.",
5
5
  "keywords": [
6
6
  "yeoman-generator",
@@ -43,7 +43,7 @@
43
43
  "yosay": "^3.0.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@types/mocha": "^10.0.3",
46
+ "@types/mocha": "^10.0.6",
47
47
  "@types/node": "^16.x",
48
48
  "mocha": "^10.2.0",
49
49
  "yeoman-environment": "^3.19.3",
@@ -1,23 +0,0 @@
1
- const path = require('path');
2
-
3
- const { runTests } = require('@vscode/test-electron');
4
-
5
- async function main() {
6
- try {
7
- // The folder containing the Extension Manifest package.json
8
- // Passed to `--extensionDevelopmentPath`
9
- const extensionDevelopmentPath = path.resolve(__dirname, '../');
10
-
11
- // The path to the extension test script
12
- // Passed to --extensionTestsPath
13
- const extensionTestsPath = path.resolve(__dirname, './suite/index');
14
-
15
- // Download VS Code, unzip it and run the integration test
16
- await runTests({ extensionDevelopmentPath, extensionTestsPath });
17
- } catch (err) {
18
- console.error('Failed to run tests', err);
19
- process.exit(1);
20
- }
21
- }
22
-
23
- main();
@@ -1,36 +0,0 @@
1
- const path = require('path');
2
- const Mocha = require('mocha');
3
- const glob = require('glob');
4
-
5
- async function run() {
6
- // Create the mocha test
7
- const mocha = new Mocha({
8
- ui: 'tdd',
9
- color: true
10
- });
11
-
12
- const testsRoot = path.resolve(__dirname, '..');
13
- const files = await glob('**/**.test.js', { cwd: testsRoot });
14
-
15
- // Add files to the test suite
16
- files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
17
-
18
- try {
19
- return new Promise((c, e) => {
20
- // Run the mocha test
21
- mocha.run(failures => {
22
- if (failures > 0) {
23
- e(new Error(`${failures} tests failed.`));
24
- } else {
25
- c();
26
- }
27
- });
28
- });
29
- } catch (err) {
30
- console.error(err);
31
- }
32
- }
33
-
34
- module.exports = {
35
- run
36
- };
@@ -1,23 +0,0 @@
1
- import * as path from 'path';
2
-
3
- import { runTests } from '@vscode/test-electron';
4
-
5
- async function main() {
6
- try {
7
- // The folder containing the Extension Manifest package.json
8
- // Passed to `--extensionDevelopmentPath`
9
- const extensionDevelopmentPath = path.resolve(__dirname, '../../');
10
-
11
- // The path to test runner
12
- // Passed to --extensionTestsPath
13
- const extensionTestsPath = path.resolve(__dirname, './suite/index');
14
-
15
- // Download VS Code, unzip it and run the integration test
16
- await runTests({ extensionDevelopmentPath, extensionTestsPath });
17
- } catch (err) {
18
- console.error('Failed to run tests', err);
19
- process.exit(1);
20
- }
21
- }
22
-
23
- main();
@@ -1,32 +0,0 @@
1
- import * as path from 'path';
2
- import Mocha from 'mocha';
3
- import { glob } from 'glob';
4
-
5
- export async function run(): Promise<void> {
6
- // Create the mocha test
7
- const mocha = new Mocha({
8
- ui: 'tdd',
9
- color: true
10
- });
11
-
12
- const testsRoot = path.resolve(__dirname, '..');
13
- const files = await glob('**/**.test.js', { cwd: testsRoot });
14
-
15
- // Add files to the test suite
16
- files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
17
-
18
- try {
19
- return new Promise<void>((c, e) => {
20
- // Run the mocha test
21
- mocha.run(failures => {
22
- if (failures > 0) {
23
- e(new Error(`${failures} tests failed.`));
24
- } else {
25
- c();
26
- }
27
- });
28
- });
29
- } catch (err) {
30
- console.error(err);
31
- }
32
- }
@@ -1,23 +0,0 @@
1
- import * as path from 'path';
2
-
3
- import { runTests } from '@vscode/test-electron';
4
-
5
- async function main() {
6
- try {
7
- // The folder containing the Extension Manifest package.json
8
- // Passed to `--extensionDevelopmentPath`
9
- const extensionDevelopmentPath = path.resolve(__dirname, '../../');
10
-
11
- // The path to test runner
12
- // Passed to --extensionTestsPath
13
- const extensionTestsPath = path.resolve(__dirname, './suite/index');
14
-
15
- // Download VS Code, unzip it and run the integration test
16
- await runTests({ extensionDevelopmentPath, extensionTestsPath });
17
- } catch (err) {
18
- console.error('Failed to run tests', err);
19
- process.exit(1);
20
- }
21
- }
22
-
23
- main();
@@ -1,32 +0,0 @@
1
- import * as path from 'path';
2
- import Mocha from 'mocha';
3
- import { glob } from 'glob';
4
-
5
- export async function run(): Promise<void> {
6
- // Create the mocha test
7
- const mocha = new Mocha({
8
- ui: 'tdd',
9
- color: true
10
- });
11
-
12
- const testsRoot = path.resolve(__dirname, '..');
13
- const files = await glob('**/**.test.js', { cwd: testsRoot });
14
-
15
- // Add files to the test suite
16
- files.forEach(f => mocha.addFile(path.resolve(testsRoot, f)));
17
-
18
- try {
19
- return new Promise<void>((c, e) => {
20
- // Run the mocha test
21
- mocha.run(failures => {
22
- if (failures > 0) {
23
- e(new Error(`${failures} tests failed.`));
24
- } else {
25
- c();
26
- }
27
- });
28
- });
29
- } catch (err) {
30
- console.error(err);
31
- }
32
- }