-
Please provide details about:
Based on a recent blog post of Sindresorhus I'm trying to convert my most low level npm package to node 12. "type": "module",
"exports": "./dist/index.js",
"engines": { "node": ">=12.13" },
Ever since this I cannot execute Ava tests. I get this error:
No error. Here is my repo: https://github.com/mesqueeb/is-what/tree/esm See the esm branch ↑ Also, this is the Ava config:
I know there are so many recourses about ESM, but it's come to a point where everyone is saying different things and I can't seem to figure out exactly what I'm doing wrong. If someone can point me into the correct direction, that would be great! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 13 replies
-
Looking at the configuration you've shared here, AVA must be treating the test file as CJS. This feels like a TypeScript compilation issue to me, to do with compatibility between the module formats. Try compiling the code directly and see if that gives you better clues. We're looking to make some changes here as part of the AVA 4 work. |
Beta Was this translation helpful? Give feedback.
-
To anyone coming here, it's easiest to look at these "differences" for setting up Ava tests with TypeScript only: |
Beta Was this translation helpful? Give feedback.
To anyone coming here, it's easiest to look at these "differences" for setting up Ava tests with TypeScript only:
https://github.com/TypeStrong/ts-node-repros/compare/ava-tests-native-esm