Test component fixture token palette restoration - #335696
Test component fixture token palette restoration#335696Henning Dieterichs (hediet) merged 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The focused test change correctly exercises restoration while reliably preserving global test state.
Review tier: Balanced
Findings: None
What changed in this PR
Adds regression coverage for restoring the shared token palette after fixture tokenizer disposal.
Changes:
- Installs a valid sentinel color map before tokenizer acquisition.
- Verifies final disposal restores the sentinel.
- Restores the original test palette in
finally.
| File | Description |
|---|---|
src/vs/workbench/test/browser/componentFixtures/fixtureSyntaxHighlighting.test.ts |
Strengthens palette restoration and test isolation coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Follow-up to #335568.\n\nThis installs a distinct valid sentinel token color map before acquiring the shared fixture tokenizers, verifies that disposing the final fixture restores that sentinel, and restores the test process's original palette in a finally block. This exercises the production restoration branch without installing an invalid color map that can crash existing color-map consumers.\n\nValidation:\n- npm run transpile-client\n- npm exec eslint -- src/vs/workbench/test/browser/componentFixtures/fixtureSyntaxHighlighting.test.ts\n- scripts\test.bat --run src\vs\workbench\test\browser\componentFixtures\fixtureSyntaxHighlighting.test.ts