Configuration
esdev test --setup=./test/setup.ts # imported before every test file esdev test --timeout=5000 # a file that takes longer is stopped esdev test --reporter=json # one JSON object per line
Each is also an esdev.json key, because a project's setup files and its per-file budget are properties of the project — a flag repeated in every script is one that gets repeated differently in two of them. A flag beats the file.
{ "test": { "setup": ["./test/setup.ts"], "globalSetup": "./test/database.ts", "timeout": 5000, "jobs": 4, "isolation": "process", "reporter": "json" } }
| Key | Flag | |
|---|---|---|
setup | --setup | Modules imported before every test file |
globalSetup | --global-setup | Modules run once for the whole run (Global setup) |
timeout | --timeout | Milliseconds one file may take before it is stopped |
jobs | --jobs | How many files run at once |
isolation | --isolation | process (default) or none (Sharing one runtime) |
reporter | --reporter | human (default), json, junit, tap or dots (Reporters) |
browser | --browser | Run in a real browser (Browser testing) |
maxConcurrency | --max-concurrency | How many concurrent cases in one file run at once; 5 by default |
coverage | --coverage | What coverage measures and writes (Coverage) |
tags, strictTags | — | The tags tests may carry (Tags) |
The project's top-level settings apply to tests: jsx, resolve.alias and plugins. --config=<path> reads another file in place of ./esdev.json.
A setup module is imported before the file under test, so a global it stubs is in place before anything reads it — and it costs no line numbers: a failing assertion still names the line you wrote.
For process-isolated runs, --timeout is enforced by the parent, which ends the process. The case it exists for is a file that wedges, and a budget the file kept for itself is one it never gets round to noticing. There is no default: a suite is not a place to guess how long a machine takes.
In a browser run, --timeout bounds the wait for the page to finish its tests. Browser control commands have a separate, fixed 30-second reply deadline, including setup, navigation and context cleanup. A browser that keeps its connection open but stops replying fails with the command name and the browser did not answer within 30000ms.
An include pattern for discovery: test files are found by their *.test.* and *.spec.* names.