Commit 04099a6
feat: add local view regression test command (#569)
Adds a debug-only command 'copilot-token-tracker.runLocalViewRegression'
that opens each webview panel in sequence, injects a DOM probe script,
waits for real content to appear, and prints a pass/fail summary to the
Output channel.
Key implementation details:
- viewRegression.ts: pure helper module (probe config, evaluator, formatter)
- Probe script calls acquireVsCodeApi() first then patches window.acquireVsCodeApi
to return the cached instance, so the main bundle can call it safely without
throwing 'An instance has already been acquired'
- Probe script is injected before the main bundle <script> so it begins
watching the DOM immediately
- onDidReceiveMessage is registered before webview.html is assigned so no
messages are missed
- Real local session data is used by default; bundled fixtures are the fallback
if no session files exist on disk
- 4 unit tests for helper logic (all passing)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent ff1ff98 commit 04099a6
File tree
7 files changed
+760
-33
lines changed- vscode-extension
- src
- test
- integration
- unit
7 files changed
+760
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
110 | 121 | | |
111 | 122 | | |
112 | 123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
63 | 68 | | |
64 | 69 | | |
65 | 70 | | |
| |||
0 commit comments