@vscode/test-web 0.0.13 → 0.0.17

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.
package/.yarnrc ADDED
@@ -0,0 +1 @@
1
+ --ignore-engines true
package/CHANGELOG.md CHANGED
@@ -1,5 +1,24 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.17
4
+ * new options `--host` and `--port`: If provided runs the server from the given host and port.
5
+ * new option `--verbose` to print out the browser console log.
6
+
7
+ ## 0.0.16
8
+ * new option `--sourcesPath`: If provided, runs the server from VS Code sources at the given location.
9
+ * option `--version` is deprecated and replaced with `quality`. Supported values: `stable`, `insiders`. Instead of `sources` use `--insiders`
10
+
11
+ ## 0.0.14
12
+ * new option `--extensionPath` : A path pointing to a folder containing additional extensions to include. Argument can be provided multiple times.
13
+ * new option `--permission`: Permission granted to the opened browser: e.g. clipboard-read, clipboard-write. See full list of options [here](https://playwright.dev/docs/1.14/emulation#permissions). Argument can be provided multiple times.
14
+ * new option `--hideServerLog`: If set, hides the server log. Defaults to true when an extensionTestsPath is provided, otherwise false.
15
+ * close server when browser is closed
16
+
17
+ ## 0.0.9
18
+
19
+ * new option `folderPath`: A local folder to open VS Code on. The folder content will be available as a virtual file system and opened as workspace.
20
+
21
+
3
22
  ### 0.0.1 |
4
23
 
5
24
  - Initial version
package/README.md CHANGED
@@ -1,12 +1,17 @@
1
1
  # @vscode/test-web
2
2
 
3
- ![Test Status Badge](https://github.com/microsoft/vscode-test-web/workflows/Tests/badge.svg)
3
+ This module helps testing VS Code web extensions locally.
4
4
 
5
- This module helps testing [VS Code web extensions](https://code.visualstudio.com/api/extension-guides/web-extensions) locally.
5
+ [![Test Status Badge](https://github.com/microsoft/vscode-test-web/workflows/Tests/badge.svg)](https://github.com/microsoft/vscode-test-web/actions/workflows/tests.yml)
6
+ [![npm Package](https://img.shields.io/npm/v/@vscode/test-web.svg?style=flat-square)](https://www.npmjs.org/package/@vscode/test-web)
7
+ [![NPM Downloads](https://img.shields.io/npm/dm/@vscode/test-web.svg)](https://npmjs.org/package/@vscode/test-web)
6
8
 
7
- The node module runs a local web server that serves VS Code for the browser including the extensions located at the given local path. Additionally the extension tests are automatically run.
8
9
 
9
- The node module providers a command line as well as an API.
10
+ See the [web extensions guide](https://code.visualstudio.com/api/extension-guides/web-extensions) to learn about web extensions.
11
+
12
+ The node module runs a local web server that serves VS Code in the browser including the extension under development. Additionally the extension tests are automatically run.
13
+
14
+ The node module provides a command line as well as an API.
10
15
 
11
16
  ## Usage
12
17
 
@@ -30,47 +35,59 @@ Open VS Code in the Browser on a folder with test data from the local disk:
30
35
  vscode-test-web --browserType=chromium --extensionDevelopmentPath=$extensionLocation $testDataLocation
31
36
  ```
32
37
 
33
- VS Code Browser will open on a virtual workspace (scheme `vscode-test-web`), backed by a file system provider that gets the file/folder data from the local disk. Changes to the file system are kept in memory and are not written back to disk.
38
+ VS Code for the Web will open on a virtual workspace (scheme `vscode-test-web`), backed by a file system provider that gets the file/folder data from the local disk. Changes to the file system are kept in memory and are not written back to disk.
34
39
 
35
40
  Via API:
36
41
 
37
42
  ```ts
38
43
  async function go() {
39
- try {
40
- // The folder containing the Extension Manifest package.json
41
- const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
42
-
43
- // The path to module with the test runner and tests
44
- const extensionTestsPath = path.resolve(__dirname, './suite/index');
45
-
46
- // Start a web server that serves VSCode in a browser, run the tests
47
- await runTests({ browserType: 'chromium', extensionDevelopmentPath, extensionTestsPath });
48
- } catch (err) {
49
- console.error('Failed to run tests');
50
- process.exit(1);
51
- }
44
+ try {
45
+ // The folder containing the Extension Manifest package.json
46
+ const extensionDevelopmentPath = path.resolve(__dirname, '../../../');
47
+
48
+ // The path to module with the test runner and tests
49
+ const extensionTestsPath = path.resolve(__dirname, './suite/index');
50
+
51
+ // Start a web server that serves VSCode in a browser, run the tests
52
+ await runTests({
53
+ browserType: 'chromium',
54
+ extensionDevelopmentPath
55
+ extensionTestsPath
56
+ });
57
+ } catch (err) {
58
+ console.error('Failed to run tests');
59
+ process.exit(1);
60
+ }
52
61
  }
53
62
 
54
63
  go()
55
64
  ```
56
65
 
57
66
  CLI options:
58
- ```
59
- --browserType 'chromium' | 'firefox' | 'webkit': The browser to launch
60
- --extensionDevelopmentPath path. [Optional]: A path pointing to a extension to include.
61
- --extensionTestsPath path. [Optional]: A path to a test module to run
62
- --version. 'insiders' (Default) | 'stable' | 'sources' [Optional]
63
- --open-devtools. Opens the dev tools [Optional]
64
- --headless. Whether to show the browser. Defaults to true when an extensionTestsPath is provided, otherwise false. [Optional]
65
- folderPath. A local folder to open VS Code on. The folder content will be available as a virtual file system`
66
67
 
67
- ```
68
+ |Option|Argument Description|
69
+ |-----|-----|
70
+ | --browserType | The browser to launch: `chromium` (default), `firefox` or `webkit` |
71
+ | --extensionDevelopmentPath | A path pointing to an extension under development to include. |
72
+ | --extensionTestsPath | A path to a test module to run. |
73
+ | --quality | `insiders` (default), or `stable`. Ignored when sourcesPath is provided. |
74
+ | --sourcesPath | If set, runs the server from VS Code sources located at the given path. Make sure the sources and extensions are compiled (`yarn compile` and `yarn compile-web`) |
75
+ | --headless | If set, hides the browser. Defaults to true when an extensionTestsPath is provided, otherwise false. |
76
+ | --permission | Permission granted to the opened browser: e.g. `clipboard-read`, `clipboard-write`. See [full list of options](https://playwright.dev/docs/api/class-browsercontext#browser-context-grant-permissions). Argument can be provided multiple times. |
77
+ | --folder-uri | URI of the workspace to open VS Code on. Ignored when `folderPath` is provided |
78
+ | --extensionPath | A path pointing to a folder containing additional extensions to include. Argument can be provided multiple times. |
79
+ | --host | The host name the server is opened on. Defaults to `localhost` |
80
+ | --port | The port the server is opened on. Defaults to `3000` |
81
+ | --open-devtools | If set, opens the dev tools in the browser |
82
+ | --verbose | If set, prints out more information when running the server |
83
+ | --hideServerLog | If set, hides the server log. Defaults to true when an extensionTestsPath is provided, otherwise false. |
84
+ | folderPath | A local folder to open VS Code on. The folder content will be available as a virtual file system and opened as workspace. |
68
85
 
69
86
  Corresponding options are available in the API.
70
87
 
71
88
  ## Development
72
89
 
73
- - `yarn install`
90
+ - `yarn && yarn install-extensions`
74
91
  - Make necessary changes in [`src`](./src)
75
92
  - `yarn compile` (or `yarn watch`)
76
93