Quick Start
Create a test file
Section titled “Create a test file”Create a file named test/math.spec.ts:
import { describe, it, expect } from "unrift";
describe("math", () => { it("adds numbers", () => { expect(1 + 2).toBe(3); });
it("compares objects deeply", () => { expect({ a: 1, b: [2, 3] }).toEqual({ a: 1, b: [2, 3] }); });});Run it
Section titled “Run it”npx unriftUnrift discovers *.spec.ts and *.test.ts files (and other supported extensions) in the test/ directory by default.
Filter tests
Section titled “Filter tests”Pass a regex pattern as the first argument to run a subset of files:
npx unrift math # only files matching /math/Add a script
Section titled “Add a script”Add a test script to your package.json:
{ "scripts": { "test": "unrift" }}Then run with npm test, pnpm test, or yarn test.
Next steps
Section titled “Next steps”- Configure test directory, timeouts, and more
- Explore all matchers available on
expect() - Set up hooks for test setup and teardown