Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🔧 Add launch configuration to run tests with VSCode debugger #1176

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
* text=auto eol=lf
/__snapshots__/** linguist-generated=true
/contributors/* linguist-generated=true
/README.md linguist-generated=true
/**/*.generated.* linguist-generated=true
8 changes: 8 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
"restart": true,
"timeout": 180000,
"outFiles": ["${workspaceRoot}/packages/vscode-extension/dist/**/*.js"]
},
{
"type": "node",
"request": "launch",
"name": "Run Unit Tests",
"program": "${workspaceFolder}/node_modules/mocha/bin/_mocha",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
],
"compounds": [
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ If you're using VS Code to develop Spyglass:

- Install the recommended [ESLint extension][eslint-extension]. Make a copy of `.vscode/settings.template.json` and rename it to `.vscode/settings.json`.
Now your VS Code should automatically fix all linting errors every time you save the file.
- Press F5 to run the VS Code extension in development environment. VS Code will automatically compile all packages and build the extension file in watch mode.
- Press F5 to run the VS Code extension in development environment (`Launch Client`). VS Code will automatically compile all packages and build the extension file in watch mode.

Or if you prefer the command line interface:

Expand All @@ -49,6 +49,8 @@ Or if you prefer the command line interface:

Please refrain from using `mocha --watch`, as it might interface with and break the snapshot testing.

You can debug tests with breakpoints by running the `Run Unit Tests` configuration and setting your breakpoints accordingly. If you want to run a specific subset of tests, add `.only` after the test block (e.g. `describe.only()`, `it.only()`).

### Code style

Tabs for indents, spaces for alignment. Except do not align things because the available tooling is unfortunately terrible.
Expand Down
Loading