Writing tests
Import the API from themeow:test built-in module. There’s nothing
to install.
math.test.ts
Discovery
meow test walks the project and runs every file whose name ends in .test.
or .spec. with a JS/TS extension (.ts, .tsx, .js, .jsx, .mts,
.mjs, .cts, .cjs). It skips node_modules, target, vendor, and hidden
directories.
Matchers
Theexpect() API covers the essentials, each with a .not inverse:
| Matcher | Passes when |
|---|---|
toBe(v) | Object.is(actual, v) (identity / primitive equality) |
toEqual(v) | deep structural equality |
toBeNull() | value is null |
toBeDefined() | value is not undefined |
toBeTruthy() / toBeFalsy() | truthiness |
toThrow() | calling the function throws |
.not | inverts any of the above |
Output
Determinism is the default
Tests always run in a deterministic strict-web isolate, no matter your
project mode. The clock is frozen, randomness is seeded, and the
timezone is pinned — so time- and random-dependent tests are stable instead of
flaky. If a test genuinely needs real time or host access, that’s a deliberate
grant, not the default.
The meow:test API
Full type signatures for test() and expect().