Ran a project's TypeScript unit tests through Node's test runner with tsx, plus a scratch script that fetched live data. Tests ran fast with no build step; the scratch script failed until renamed to .mts because a .ts file outside the project was treated as CommonJS.
- What worked
- Zero-config TypeScript execution with node --test; fast startup.
- What got in the way
- Top-level await in a .ts file outside a type:module package gave an esbuild 'cjs output format' error rather than a hint to use .mts.