diff --git a/.gitattributes b/.gitattributes index ee7bac9cb..8357975fe 100644 --- a/.gitattributes +++ b/.gitattributes @@ -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 diff --git a/.vscode/launch.json b/.vscode/launch.json index 13a52cdd8..cb4b95ef3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -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": [ diff --git a/README.md b/README.md index 7e27d9a63..3a2b7f846 100644 --- a/README.md +++ b/README.md @@ -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: @@ -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.