Skip to content

Commit 5b1c42d

Browse files
committed
add readme section about customising launch configuration
1 parent 1ed9878 commit 5b1c42d

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed

README.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,48 @@ You can, of course, change these in your user settings, or on a per project basi
6161

6262
## Advanced Configuration
6363

64+
### Customizing launch config for test runner
65+
66+
The test runner builds a launch configuration dynamically basing on hardcoded default values:
67+
68+
```js
69+
{
70+
"type": "mix_task",
71+
"name": "mix test",
72+
"request": "launch",
73+
"task": "test",
74+
"env": {
75+
"MIX_ENV": "test",
76+
},
77+
"taskArgs": buildTestCommandArgs(args, debug),
78+
"startApps": true,
79+
"projectDir": args.cwd,
80+
// we need to require all test helpers and only the file we need to test
81+
// mix test runs tests in all required files even if they do not match
82+
// given path:line
83+
"requireFiles": [
84+
"test/**/test_helper.exs",
85+
"apps/*/test/**/test_helper.exs",
86+
args.filePath,
87+
],
88+
"noDebug": !debug,
89+
}
90+
```
91+
92+
The default launch config can be customized by providing a project launch configuration named `mix test`. If found, this launch config is used as default for running and debugging tests.
93+
94+
Example:
95+
96+
```json
97+
{
98+
"type": "mix_task",
99+
"name": "mix test",
100+
"request": "launch",
101+
"debugAutoInterpretAllModules": false,
102+
"debugInterpretModulesPatterns": ["MyApp*"]
103+
}
104+
```
105+
64106
### Add support for emmet
65107

66108
`emmet` is a plugin that makes it easier to write HTML: https://code.visualstudio.com/docs/editor/emmet

0 commit comments

Comments
 (0)