testing
Guide for writing tests in Agent Lens. Use when creating unit tests, integration tests, or setting up test infrastructure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Guide for writing tests in Agent Lens. Use when creating unit tests, integration tests, or setting up test infrastructure.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
Investigate and fix a bug using the project's TDD workflow. Use when given a bug report or GitHub issue to fix.
Background knowledge about the Agent Lens VS Code extension architecture. Preloaded by agents for project context.
Guide for developing the Agent Lens VS Code extension. Use when creating or modifying extension code, webviews, tree views, or commands.
Guide for writing tests. Use this when creating unit tests, integration tests, or setting up test infrastructure.
Guide for developing VS Code extensions. Use this when creating or modifying extension code, webviews, tree views, or commands.
| name | testing |
| description | Guide for writing tests in Agent Lens. Use when creating unit tests, integration tests, or setting up test infrastructure. |
vitest.config.ts (globals enabled, includes src/**/*.test.ts and webview/**/*.test.ts)npm testnpx vitest run src/parsers/agentParser.test.tsnpm run test:watchsrc/parsers/foo.ts → src/parsers/foo.test.tsdescribe / it blocksexpect assertionsdescribe, it, expect)| Layer | What to test | Example file |
|---|---|---|
| Parsers | Pure function input/output, edge cases, malformed input | agentParser.test.ts |
| Analyzers | Graph construction, metrics aggregation, edge cases | graphBuilder.test.ts |
| Detectors | Detection logic for agents, skills, tools, MCP servers | detectors.test.ts |
| Layout | D3-DAG layout algorithm, cycle handling | webview/layout.test.ts |
fs and vscode.workspace at boundariesdescribe("parserName", () => {
it("should parse valid input", () => {
const result = parseAgent(validMarkdown);
expect(result.name).toBe("expected");
});
it("should handle missing frontmatter", () => {
const result = parseAgent("no frontmatter here");
expect(result.name).toBe("");
});
});