Skip to content

Commit 95f605b

Browse files
authored
Make it easier to have unit tests in VSCode packages (#1541)
Introduces a new convention for tests that end with `.vscode.test.ts` must run within VSCode; other tests can be run as unit tests outside of VSCode. This makes it easier to add unit tests within packages such as `cursorless-vscode`. Just because a package is designed to be used with VSCode doesn't mean that all of its tests should have to be run within a VSCode context. It might (and should!) have support code that consists of pure functions with no dependencies. - Required by #1523 ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [x] I have not broken the cheatsheet
1 parent a8ea10d commit 95f605b

25 files changed

+26
-31
lines changed

docs/contributing/CONTRIBUTING.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ Run the `workbench.action.debug.selectandstart` command and then select
7676

7777
See [test-case-recorder.md](./test-case-recorder.md).
7878

79+
It is also possible to write manual tests. When doing so, we have a convention that any test that must be run within a VSCode context (eg because it imports `"vscode"`), should be placed in a file with the suffix `.vscode.test.ts`. All other tests should end with just `.test.ts`. This allows us to run non-VSCode tests locally outside of VSCode using the `Run unit tests` launch config. These tests run much faster than the full VSCode test suite.
80+
7981
## Parse tree support
8082

8183
### Adding a new programming language

0 commit comments

Comments
 (0)