Skip to content

Commit

Permalink
doc: why
Browse files Browse the repository at this point in the history
  • Loading branch information
ChALkeR committed Aug 5, 2024
1 parent 074b190 commit fb84445
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# @exodus/test

A runner for `node:test`, `jest`, and `tape` test suites on top of `node:test`
A runner for `node:test`, `jest`, and `tape` test suites on top of `node:test` (and any runtime)

Most likely it will just work on your simple jest tests as as drop-in replacement

Expand All @@ -10,6 +10,46 @@ Use `--coverage` to generate coverage output

Default `NODE_ENV` value is "test", use `NODE_ENV=` to override (e.g. to empty)

## Why?

- Can run your tests on Node.js, Bun, Deno, JavaScriptCore and Hermes without extra churn

- Unlike `jest`, it is fast

- Unlike `node:test`, it is a drop-in replacement for `jest`

- With `expect`, support for snapshots, mocks and matchers

- `jest-when` and `jest-extended` are fully compatible and can just be used

- Snapshots are compatible with Jest and can just be used both ways

- Also compatible to `node:test`

- Unlike `bun:test`, it runs all test files in isolated contexts

Bun leaks globals between test files and has incompatible `test()` lifecycle / order

- Can use Jest config

- Native coverage support (enable via `--coverage`)

- Can record / replay `fetch` and `WebSocket` sessions. And run them on all runtimes (including Hermes)

- Automatic polyfills for JavaScriptCore / Hermes, including crypto

- Hanging tests error by default (unlike `jest`)

- Native ESM out of the box

- Esbuild on the fly for babelified ESM interop (enable via `--esbuild`)

- TypeScript support in both transform (enable via `--esbuild`) and typestrip (via `--typescript`) modes

- Babel support, picks up your Babel config (enable via `--babel`)

- `--drop-network` support for guaranteed offline testing

## Library

### Using with `node:test` natively
Expand Down

0 comments on commit fb84445

Please sign in to comment.