Skip to content

Quick Start

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] });
});
});
Terminal window
npx unrift

Unrift discovers *.spec.ts and *.test.ts files (and other supported extensions) in the test/ directory by default.

Pass a regex pattern as the first argument to run a subset of files:

Terminal window
npx unrift math # only files matching /math/

Add a test script to your package.json:

{
"scripts": {
"test": "unrift"
}
}

Then run with npm test, pnpm test, or yarn test.