vitest-runner
Run Vitest tests and parse results into actionable output.
它会碰到什么
这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。
技能内容
Vitest runner
Run existing Vitest tests and report results. A check-only request does not authorize changing tests, assertions, dependencies, or configuration.
Run
Read repository instructions and package scripts. Check package.json, vitest.config., and vite.config. to confirm Vitest and its test configuration. Use the installed project version; avoid implicit npx downloads. If Vitest is unavailable, report setup needed rather than installing it.
Use the repository test command or these defaults. Always use run; bare vitest can enter watch mode.
| Scope | Command |
|---|---|
| Whole configured suite | npx vitest run --reporter=verbose 2>&1 |
| File or directory | npx vitest run path/to/test.ts 2>&1 |
| Test-name pattern | npx vitest run -t "pattern" 2>&1 |
| Requested coverage | npx vitest run --coverage 2>&1 |
Capture the process exit code and full output. Report pass/fail, checked scope, passed/failed/skipped counts, and duration. For failures retain the file, full test name, assertion difference, and relevant stack location. Keep complete logs available; show useful excerpts instead of every passing test. Nonzero exit is failure, including discovery or tool failures; partial output is not a passing run.
Recovery
- Vitest missing/node_modules absent: inspect dependencies. Setup may require
npm installornpm install -D vitest; use the repository package manager during authorized setup. - No test files: check file naming (
.test.ts,.spec.ts,*.test.js) and configured include/exclude globs. Report discovery failure; do not change config to mask it. - Missing DOM environment: inspect
environmentforjsdomorhappy-dom. Suggest the matching devDependency (npm install -D jsdomornpm install -D happy-dom);@testing-library/jest-domadds matchers, not an environment. - Out of memory: diagnose with directory batches such as
npx vitest run src/unit/,--pool=forks, or--shard=1/Nwhen supported by the installed version. A full-suite claim requires all batches/shards; a diagnostic subset is not full verification. - Failing assertions: report the mismatch. When fixing is authorized, determine whether implementation or test is wrong; never weaken assertions merely to make the run green.
想直接用这个技能?
本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。