Commit 2d6ab4f
committed
fix: prevent TestVSCode from writing to real settings.json
TestVSCode runs the full command via TestCmd which calls
createConnectionProfile -> getVSCodeSettingsPath, resolving to the
real %APPDATA%\Code\User\settings.json. This silently mutates the
developer's actual VS Code settings on every test run.
Add testSettingsPathOverride hook so TestVSCode redirects writes to
t.TempDir(). The hook is cleared in t.Cleanup so other tests like
TestVSCodeGetSettingsPath still exercise the real path resolution.1 parent 2f099de commit 2d6ab4f
2 files changed
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
23 | 27 | | |
24 | 28 | | |
25 | 29 | | |
| |||
281 | 285 | | |
282 | 286 | | |
283 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
284 | 292 | | |
285 | 293 | | |
286 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
31 | 36 | | |
32 | 37 | | |
33 | 38 | | |
| |||
0 commit comments