Repository navigation
Add unit and extension-host tests - #38
Merged
Merged
Conversation
Split the vscode-free graph logic out of model.ts into graph.ts so it runs under plain Node, and add an extension-host suite that drives the registered commands in a real VS Code against a fixture workspace. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01G6hKb9Lpz4vBWMgPJS7N6D
ChrisonSimtian
added a commit
that referenced
this pull request
Nov 16, 2026
…cks (#39) More test coverage on top of #38. Closes #37. **Bug fix:** clicking a node in the graph posted `run` for target `flowchart`. Mermaid 11 prefixes node ids with the render id, so `id.split('-')[1]` picked the wrong segment. The page now matches the target name explicitly. Found by the new webview test. - **Unit:** `RunConfigStore` (parameters, secrets kept out of workspace state, args, env), tree sort and relations. Moved out of `runConfig.ts` / `extension.ts` into `runConfigStore.ts` / `graph.ts`, no behaviour change. - **Extension-host:** `goToTarget` picks the right file when two types declare the same target (`declaredIn`). - **Webview** (`npm run test:webview`): `src/graphPage.ts` holds the page HTML; `playwright-core` loads it in installed Chrome or Edge with `acquireVsCodeApi` stubbed. Covers `ready`, rendering, solid/dashed/thick edges, default-target styling, click → `run`, re-render. - **Contract** (`npm run test:contract`, needs .NET): runs `dotnet fallout --plan` so Fallout emits a real `build-graph.json`, then checks the extension's assumptions. Found that `description` is emitted as `null`; the type now allows it. - Docs updated. CI wiring follows in a separate commit on this PR. Verified: unit 28, webview 6, extension-host 5, contract 9, all passing locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a two-layer test suite so changes can be verified from the command line.
npm testruns both.node:test, plain Node): graph parsing, discovery, compatibility checks, Mermaid edge styles. Neededsrc/graph.ts, split out ofsrc/model.ts, which re-exports it — no import changes elsewhere.@vscode/test-cli): real VS Code ontest/fixtures/workspace. Checks activation, all 6 commands registered,goToTargetlanding on the declaration,showGraphopening the panel.AGENTS.md,CONTRIBUTING.md,docs/issue-and-pr-style.mdno longer say there is no test suite. New Tests section inCONTRIBUTING.md..vsix.Not in this PR:
build.ymlis generated, so it needs a Fallout target first.goToTargetonly exercises the regex fallback (no C# extension in the test host).Verified:
npm testpasses (12 unit, 4 extension-host);vsce lslists no test files.🤖 Generated with Claude Code
https://claude.ai/code/session_01G6hKb9Lpz4vBWMgPJS7N6D