Testing
Unit, conformance, golden image, integration and agent scenario tests, and what CI runs.
Esta página está em inglês; a tradução está a caminho.
npm run test:unit # mocha over out/test: unit, conformance, commands, CLI, MCP, Plugin API, text, golden, layout, interop
npm run test:integration # the extension inside a VS Code test instance (vscode-test)
npm run check:webview # the webview page contract (no framework, no stylesheet, module rules)
npm test # test:unit and check:webview
npm run test:cli # only the CLI and MCP testsRun npm run compile first: the tests run from out/.
Golden images#
test/golden renders fixture designs and compares them with the expected images. After an intended rendering change, npm run golden:update rewrites the expected images; review them before committing.
Agent scenarios#
test/agent-scenarios holds end-to-end scenarios in which Claude Code designs through ud mcp with the shipped skills: a login screen, variables with modes, button variants, a frame to React, a review, quick actions and the AI panel’s own pipeline. Each scenario sets its prompt, fixture, models, allowed tools and checks (selectors, lint, renders, image similarity, code).
npm run test:agents -- --scenario S1 --runs 1 --claude test/agent-scenarios/mock-claude/claude.mjs # smoke run, no model
npm run test:agents -- --scenario S1 # real run, needs Claude Code
npm run test:agents:replay # replay recorded transcriptsBenchmarks#
npm run bench measures the performance budgets of ARC-001 §12 on generated fixtures (npm run bench:gen).
CI#
.github/workflows/test.yml runs on Linux, macOS and Windows: npm ci, compile, lint, the webview check, the licence check, the schema check, the unit tests and the integration tests, plus the CLI tests on Node 22 and a .vsix size check.