node-native-tests
/node-native-tests
I use node:test + borp + c8, not Jest or Vitest. The runtime ships a test runner — I use it. Use when adding tests, when an agent reaches for Jest/Vitest, when configuring coverage, or when user says "add a test", "test runner", or "borp".
- Author
- mateonunez ↗
- Repository
- skills ↗
- Licence
- MIT
- Last repository change
- 12.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 12.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
I use node:test + borp + c8, not Jest or Vitest. The runtime ships a test runner — I use it. Use when adding tests, when an agent reaches for Jest/Vitest, when configuring coverage, or when user says "add a test", "test runner", or "borp".
Triggers from the description
Original author description
I use node:test + borp + c8, not Jest or Vitest. The runtime ships a test runner — I use it. Use when adding tests, when an agent reaches for Jest/Vitest, when configuring coverage, or when user says "add a test", "test runner", or "borp".
How it works
- When this skill is active
- The setup
- Mocking
- Anti-patterns
- When the codebase already has Jest or Vitest
SKILL.md preview
---
name: node-native-tests
description: I use node:test + borp + c8, not Jest or Vitest. The runtime ships a test runner — I use it. Use when adding tests, when an agent reaches for Jest/Vitest, when configuring coverage, or when user says "add a test", "test runner", or "borp".
---
# Node-native tests
The Node.js runtime ships a test runner. I use it. No `jest`, no `vitest`, no `@types/jest`. The runner is `borp` (TAP reporter, parallel by default), coverage is `c8`.
This is a [`single-tool-per-job`](../single-tool-per-job/SKILL.md) choice: the standard library covers it, so no third-party test framework earns its place in `package.json`. The full `ait` testing setup — Docker test services, c8 invocation, package-mirroring `test/` directory — is documented at [`personal/ait/references/best-practices-testing.md`](../../personal/ait/references/best-practices-testing.md).
## When this skill is active
You are about to:
- Add a test file
- Configure a test runner or coverage tool
- Migrate from another test framework (only if I asked for it)
- Reach for `jest.mock`, `vi.mock`, or `@types/jest`
## The setup
```jsonc
// package.json
{
"scripts": {
"test": "borp",
"test:coverage": "c8 borp -T --reporter spec"
},
"devDependencies": {
"borp": "^0.x",
"c8": "^10.x"
}
}
```
In monorepos with Docker-backed test infra (PostgreSQL, Qdrant, Redis), pre/post hooks bring services up and down:
```jsonc
{
"scripts": {
"test": "pnpm run:recursive test",
"pretest": "pnpm start:services:test",
"posttest": "pnpm stop:services:test"
}
}
```
```typescript
// src/foo.spec.ts
import { describe, it } from 'node:test';
import assert from 'node:assert/strict';
import { foo } from './foo.ts';
describe('foo', () => {
it('returns ok for valid input', () => {
const r = foo('valid');
assert.equal(r.ok, true);
});
it('returns err with __type for invalid input', () => {
const r = foo('');
assert.equal(r.ok, false);
if (!r.ok) assert.equal(r.error.__type, 'empty-input');
});
});
```
File suffix is `.spec.ts` (or `.spec.js`). `borp` picks them up by default.
## Mocking
`node:test` ships `mock` from `node:test`:
```typescript
import { describe, it, mock } from 'node:test';
const fn = mock.fn(() => 42);
fn();
assert.equal(fn.mock.callCount(), 1);
```
For module-level mocks, prefer dependency injection over runtime patching. If you really need module mocking, `mock.module` is in Node 22+.
## Anti-patterns
- **Reaching for Jest or Vitest.** Don't. The runtime has a runner. If something is missing, name what — usually it isn't.
- **`@types/jest` in `devDependencies`.** That's the migration tell. Remove it.
- **`vi.mock`, `jest.mock`, `jest.fn()`** in new code. Use `mock.fn` from `node:test`.
- **`*.test.ts` instead of `*.spec.ts`.** Pick one. I use `.spec.ts`. Keep the codebase consistent.
- **Adding `tsx` or `ts-node` as a test dependency** when `node --experimental-strip-types` (Node 22.6+) or native TS support (Node 23.6+) handles it.
- **Test files importing from `./dist/`.** Test the source, not the build.
## When the codebase already has Jest or Vitest
Stop. Don't migrate unprompted. If there are 50 Jest tests, a silent rewrite is hostile. Note the existing setup, propose a migration as a separate task, and write new tests in the existing style for now. If I confirm the migration, do it in one commit with no other changes.
The exception: brand-new packages added to an existing monorepo can use `node:test` even if other packages use Jest. Each package owns its own test setup.
Versions
The database has no other skills named node-native-tests.
Database snapshot: 13.11.2026 · package version 29dd90867643 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100vitest
Vitest is a test runner for JavaScript and TypeScript built on Vite, with a Jest-compatible API, built-in mocking, snapshots and code coverage. Use when a user asks to set up or run unit tests in a Vite or Node project, write tests with describe/it/expect, mock modules with… - 100vitest
Vitest testing framework. Covers unit tests, mocking, and coverage. Use for testing Vite-based and Node.js projects. USE WHEN: user mentions "vitest", "vite test", "unit test", asks about "vi.fn", "vi.mock", "test coverage", "mock functions", "test vite project" DO NOT USE FOR:… - 100vitest
Set up Vitest testing in any project — detects type (Cloudflare Workers, React, Node, library), generates vitest.config.ts, test setup, utilities, and a sample test. Covers mocking patterns, coverage config, workspace setup, Jest migration. Use whenever the user mentions adding… - 100vitest-testing
Vitest test runner — Vite-native, ESM, watch/UI mode, coverage, mocking, snapshots. Use when setting up tests for Vite projects, migrating from Jest, or needing fast execution. - 86jest-vitest
前端测试开发专家助手。当用户需要编写前端/Node单元测试、组件测试、函数与模块mock、定时器mock、覆盖率配置或Jest与Vitest选型时调用。 - 85vitest
Vitest fast unit testing framework powered by Vite with Jest-compatible API. Use when writing tests, mocking, configuring coverage, or working with test filtering and fixtures.