Closed npapagna closed 9 months ago
this is because chai 5.x is esm-only
if you're in a commonjs project, you should stick to 4.x (which we are still supporting) or migrate to ESM (add type: "module"
to your package.json
).
you can see an example of an esm project working with ts-node and mocha here: https://gist.github.com/43081j/78ce1392abb5043b02a29355006880a5/
Thanks, it worked great!
I get
TypeError: Unknown file extension ".ts"
when trying to runmocha
tests usingts-node
withchai 5.0.0
and later. Downgrading it to4.4.1
seems to fix the issue.Check this repo with a minimal example that reproduces the bug