Skip to content

Commit

Permalink
docs: Update docs to fix #342 and coment on #340 (#348)
Browse files Browse the repository at this point in the history
* Use ${workspaceFolder} instead of ${workFolder}, fixes #342
* Clarify `changeDirectoryToWorkspaceRoot` fallback order
  • Loading branch information
domsleee authored Dec 31, 2023
1 parent b5097b3 commit 09a8ba7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 20 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,30 +52,30 @@ add the following command to settings:
Jest Runner will work out of the box, with a valid Jest config.
If you have a custom setup use the following options to customize Jest Runner:

| Command | Description |
| --- | --- |
| jestrunner.configPath | Jest config path (relative to ${workFolder} e.g. jest-config.json) |
| jestrunner.jestPath | Absolute path to jest bin file (e.g. /usr/lib/node_modules/jest/bin/jest.js) |
| jestrunner.debugOptions | Add or overwrite vscode debug configurations (only in debug mode) (e.g. `"jestrunner.debugOptions": { "args": ["--no-cache"] }`) |
| jestrunner.runOptions | Add CLI Options to the Jest Command (e.g. `"jestrunner.runOptions": ["--coverage", "--colors"]`) https://jestjs.io/docs/en/cli |
| jestrunner.jestCommand | Define an alternative Jest command (e.g. for Create React App and similar abstractions) |
| jestrunner.disableCodeLens | Disable CodeLens feature |
| jestrunner.codeLensSelector | CodeLens will be shown on files matching this pattern (default **/*.{test,spec}.{js,jsx,ts,tsx}) |
| jestrunner.codeLens | Choose which CodeLens to enable, default to `["run", "debug"]` |
| jestrunner.enableYarnPnpSupport | Enable if you are using Yarn 2 with Plug'n'Play |
| jestrunner.yarnPnpCommand | Command for debugging with Plug'n'Play defaults to yarn-*.*js |
| jestrunner.projectPath | Absolute path to project directory (e.g. /home/me/project/sub-folder), or relative path to workspace root (e.g. ./sub-folder) |
| jestrunner.changeDirectoryToWorkspaceRoot | Changes directory to workspace root before executing the test |
| jestrunner.preserveEditorFocus | Preserve focus on your editor instead of focusing the terminal on test run |
| jestrunner.runInExternalNativeTerminal | run in external terminal (requires: npm install ttab -g) |
| Command | Description |
| ----------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| jestrunner.configPath | Jest config path (relative to `${workspaceFolder}` e.g. jest-config.json) |
| jestrunner.jestPath | Absolute path to jest bin file (e.g. /usr/lib/node_modules/jest/bin/jest.js) |
| jestrunner.debugOptions | Add or overwrite vscode debug configurations (only in debug mode) (e.g. `"jestrunner.debugOptions": { "args": ["--no-cache"] }`) |
| jestrunner.runOptions | Add CLI Options to the Jest Command (e.g. `"jestrunner.runOptions": ["--coverage", "--colors"]`) https://jestjs.io/docs/en/cli |
| jestrunner.jestCommand | Define an alternative Jest command (e.g. for Create React App and similar abstractions) |
| jestrunner.disableCodeLens | Disable CodeLens feature |
| jestrunner.codeLensSelector | CodeLens will be shown on files matching this pattern (default **/*.{test,spec}.{js,jsx,ts,tsx}) |
| jestrunner.codeLens | Choose which CodeLens to enable, default to `["run", "debug"]` |
| jestrunner.enableYarnPnpSupport | Enable if you are using Yarn 2 with Plug'n'Play |
| jestrunner.yarnPnpCommand | Command for debugging with Plug'n'Play defaults to yarn-*.*js |
| jestrunner.projectPath | Absolute path to project directory (e.g. /home/me/project/sub-folder), or relative path to workspace root (e.g. ./sub-folder) |
| jestrunner.changeDirectoryToWorkspaceRoot | Changes directory before execution. The order is:<ol><li>`jestrunner.projectPath`</li><li>the nearest `package.json`</li><li>`${workspaceFolder}`</li></ol> |
| jestrunner.preserveEditorFocus | Preserve focus on your editor instead of focusing the terminal on test run |
| jestrunner.runInExternalNativeTerminal | run in external terminal (requires: npm install ttab -g) |

## Shortcuts

Command Pallette -> Preferences: Open Keyboard Shortcuts (JSON)
the json config file will open
add this:

```javascript
```json
{
"key": "alt+1",
"command": "extension.runJest"
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"jestrunner.configPath": {
"type": "string",
"default": "",
"description": "Jest config path (relative to ${workFolder} e.g. jest-config.json)",
"description": "Jest config path (relative to `${workspaceFolder}` e.g. jest-config.json)",
"scope": "window"
},
"jestrunner.jestPath": {
Expand Down Expand Up @@ -105,9 +105,9 @@
"jestrunner.changeDirectoryToWorkspaceRoot": {
"type": "boolean",
"default": true,
"description": "Changes directory to workspace root before executing the test",
"description": "Changes directory before execution. The fallback order is:\n1. `jestrunner.projectPath`\n2. the nearest `package.json`\n3. `${workspaceFolder}`",
"scope": "window"
},
},
"jestrunner.preserveEditorFocus": {
"type": "boolean",
"default": false,
Expand Down

0 comments on commit 09a8ba7

Please sign in to comment.