Skip to content

Commit

Permalink
Adds a "debug tests" vscode launch config (#238)
Browse files Browse the repository at this point in the history
* adds a "debug tests" vscode launch config

This adds a vscode launch config to newly created projects, making it easier to debug tests and code inside vscode directly. Tested this internally and it works well.

* Update pink-nails-wave.md
  • Loading branch information
threepointone authored Jan 30, 2021
1 parent a6179f2 commit beb619c
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/pink-nails-wave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'create-modular-react-app': patch
---

Adds a debug test launch config for vscode
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ describe('create-modular-react-app', () => {
├─ .gitignore #1tm0llc
├─ .vscode
│ ├─ extensions.json #1i4584r
│ ├─ launch.json #15fzacl
│ └─ settings.json #xncm1d
├─ README.md #1nksyzj
├─ modular
Expand Down
16 changes: 16 additions & 0 deletions packages/create-modular-react-app/template/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug Tests",
"type": "node",
"request": "launch",
"runtimeExecutable": "${workspaceRoot}/node_modules/.bin/modular",
"args": ["test", "--runInBand", "--no-cache", "--env=jsdom", "{file}"],
"cwd": "${workspaceRoot}",
"protocol": "inspector",
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen"
}
]
}
3 changes: 2 additions & 1 deletion packages/tree-view-for-tests/src/__tests__/tree.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,14 @@ test('it can serialise a folder', () => {
├─ package.json
├─ src
│ ├─ __tests__
│ │ └─ index.test.ts #1v8shn0
│ │ └─ index.test.ts #1g6aupe
│ ├─ cli.ts #gcx3cm
│ └─ index.ts #un0l9d
└─ template
├─ .editorconfig #1p4gvuw
├─ .vscode
│ ├─ extensions.json #1i4584r
│ ├─ launch.json #15fzacl
│ └─ settings.json #xncm1d
├─ README.md #1nksyzj
├─ gitignore #1tm0llc
Expand Down

0 comments on commit beb619c

Please sign in to comment.