fix(test): add missing devDeps + sourcemap transform + jsdom directives

WorkBuddy review found 38 of 131 spec files failed at collection time
(0 tests executed) — the '1015 passed' was a false green because vitest
only counts 'Tests failed', not 'Test Files failed'.

Root cause: dsh-client-ui-primitives@0.2.0-rc.2 declares dependencies:null
but statically imports 23 external root packages. Our project declared
only 18. Under pnpm strict layout, the missing 5 (dsh-client-store,
dsh-util-code-language, dsh-util-workspace-path, diff, simple-icons)
were unresolvable when Vite inlined the primitives package.

Fixes:
- Add 7 missing devDeps: dsh-client-store@0.2.0-rc.2,
  dsh-util-code-language@0.2.0-rc.2, dsh-util-workspace-path@0.2.0-rc.2,
  diff@9.0.0, simple-icons@16.35.0, zustand@5.0.15, immer@11.1.21
- vitest.config.ts: add transform plugin to strip sourceMappingURL
  comments from dsh-client-ui-primitives (upstream ships lib/index.js
  with trailing sourceMappingURL but package.json files excludes .map)
- 5 spec files: add @vitest-environment jsdom directive (they import
  dsh-client-ui-primitives which calls window.addEventListener at module
  load; node environment lacks window)
- Remove empty .map file hack from node_modules (ineffective + .gitignore
  blocks it from version control)

Result: Test Files 131 passed (131), Tests 1367 passed | 9 skipped,
EXIT=0.

Verified: simple-icons 25 named exports all present.
Typecheck + build pass.
This commit is contained in:
figmar
2026-10-11 19:33:01 +08:00
parent f4c44d13d6
commit a6dd8aa42a
9 changed files with 117 additions and 1 deletions
+1
View File
@@ -1,3 +1,4 @@
// @vitest-environment jsdom
/**
* apes:* tab registration tests (Phase 1/1b, C6: 3 tabs). The fork registers
* its three information-layer tabs (agents / apps / profile) through the same
+1
View File
@@ -1,3 +1,4 @@
// @vitest-environment jsdom
/**
* Built-in registration tests: the plugin registers 7 tabs and 6 file
* viewers through the same service external plugins use (dogfooding);
+1
View File
@@ -1,3 +1,4 @@
// @vitest-environment jsdom
/**
* Markdown preview copy-label spec: the fence copy buttons ("复制" / "Copy")
* must follow the DSH locale service through `codeLabels` — the DSH
+1
View File
@@ -1,3 +1,4 @@
// @vitest-environment jsdom
/**
* Markdown frontmatter preview regression (#251): a leading, closed YAML
* metadata block must not reach the shared MarkdownText parser, where its
+1
View File
@@ -1,3 +1,4 @@
// @vitest-environment jsdom
/**
* Sandbox-contract tests for the two built-in web surfaces (HTML preview
* iframe and the browser tab iframe). The iframe sandbox — opaque origin,