meow:test is the API behind meow test. Import it in any
*.test.* / *.spec.* file — there’s nothing to install, and each file runs in
its own deterministic isolate.
test()
meow test runs every registered test in the file, in order, and
reports each as ✓ or ✗.
expect()
Matchers
toBe(expected)
Passes when
Object.is(actual, expected) — identity for objects, value equality
for primitives.toEqual(expected)
Passes on deep structural equality — recursively compares arrays and plain
objects.
toBeNull()
Passes when the value is exactly
null.toBeDefined()
Passes when the value is not
undefined.toBeTruthy() / toBeFalsy()
Passes on JavaScript truthiness / falsiness.
toThrow()
Calls the actual value (which must be a function) and passes if it throws.
not
Inverts the matcher that follows:
expect(x).not.toBe(y).Examples
example.test.ts
Because every test file runs in a deterministic isolate (frozen clock, seeded
RNG, pinned timezone), assertions on time- or random-derived values are stable.
See Testing and Determinism.
Run your tests
The meow test command, discovery rules, and output.