diff options
author | Ryan Cumming <[email protected]> | 2019-06-26 12:36:40 +0100 |
---|---|---|
committer | Ryan Cumming <[email protected]> | 2019-06-26 12:38:03 +0100 |
commit | 98ac62c9d78ff5ec323c7d9aeae8845e1df20b19 (patch) | |
tree | 9139681d87c2c5f09532d47337f7cbd5c0742249 /docs/dev/README.md | |
parent | f82ceca0bd8de2a2b0b51c96c5c1678351a7a20a (diff) |
Document the VS Code extension test framework
Diffstat (limited to 'docs/dev/README.md')
-rw-r--r-- | docs/dev/README.md | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/dev/README.md b/docs/dev/README.md index 3dc37e86e..0a148ed32 100644 --- a/docs/dev/README.md +++ b/docs/dev/README.md | |||
@@ -97,6 +97,25 @@ To work on the VS Code extension, launch code inside `editors/code` and use `F5` | |||
97 | to launch/debug. To automatically apply formatter and linter suggestions, use | 97 | to launch/debug. To automatically apply formatter and linter suggestions, use |
98 | `npm run fix`. | 98 | `npm run fix`. |
99 | 99 | ||
100 | Tests are located inside `src/test` and are named `*.test.ts`. They use the | ||
101 | [Mocha](https://mochajs.org) test framework and the builtin Node | ||
102 | [assert](https://nodejs.org/api/assert.html) module. Unlike normal Node tests | ||
103 | they must be hosted inside a VS Code instance. This can be done in one of two | ||
104 | ways: | ||
105 | |||
106 | 1. When `F5` debugging in VS Code select the `Extension Tests` configuration | ||
107 | from the drop-down at the top of the Debug View. This will launch a temporary | ||
108 | instance of VS Code. The test results will appear in the "Debug Console" tab | ||
109 | of the primary VS Code instance. | ||
110 | |||
111 | 2. Run `npm test` from the command line. Although this is initiated from the | ||
112 | command line it is not headless; it will also launch a temporary instance of | ||
113 | VS Code. | ||
114 | |||
115 | Due to the requirements of running the tests inside VS Code they are **not run | ||
116 | on CI**. When making changes to the extension please ensure the tests are not | ||
117 | broken locally before opening a Pull Request. | ||
118 | |||
100 | # Logging | 119 | # Logging |
101 | 120 | ||
102 | Logging is done by both rust-analyzer and VS Code, so it might be tricky to | 121 | Logging is done by both rust-analyzer and VS Code, so it might be tricky to |