一键导入
testing
How to write and run tests in @jsenv/core. Use when adding, running, or understanding tests in any package of this monorepo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
How to write and run tests in @jsenv/core. Use when adding, running, or understanding tests in any package of this monorepo.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
How to run and verify the `*_demo.html` files scattered across packages (e.g. packages/frontend/navi/src/control/demos/). Use when the user explicitly asks to load a demo in a browser / Playwright to check it works — not proactively (see .agents/instructions.md's "never verify on your own initiative" constraint).
Workflow for creating a new UI component in @jsenv/navi. Use when implementing a new frontend component from scratch.
| name | testing |
| description | How to write and run tests in @jsenv/core. Use when adding, running, or understanding tests in any package of this monorepo. |
Testing in @jsenv/core focuses on behavior verification and regression prevention rather than exhaustive coverage. Tests capture actual behavior to ensure changes don't break existing functionality.
Run tests from the repo root to ensure the correct Node.js version (25.8.1):
node --conditions=dev:jsenv <test-file>
The dev:jsenv export condition uses source files directly — no build step needed. For packages like @jsenv/server, this avoids rebuilding dist/ after every source change.
_test-name.test.js/ directories alongside test filesDEBUG=true output appears in snapshot markdown files, not the terminaltests/ directoriesWrite tests that catch regressions and document expected behavior, not to achieve high coverage metrics.