ava 4.0.1 does not work with non-native ESM, i.e., esm shim #2953
Replies: 4 comments
-
I'm not familiar with that shim. AVA 3 has special handling for the esm shim and that has been removed. You'll have to register it as a CJS loader somehow. |
Beta Was this translation helpful? Give feedback.
-
Any guidance on how to do that?
The esm-wallaby lib is just a fork of the esm module but updated to support optional chaining (elvis operator). It works in ava 3.15.0, but fails with that error when updated to ava 4.0.1. I'm assuming this is due to removing support of esm? ava.config.cjs
|
Beta Was this translation helpful? Give feedback.
-
Correct. We used to recognize a symbol from the |
Beta Was this translation helpful? Give feedback.
-
You can specify node arguments to turn on experimental Node.js features. AVA does not do that by itself. |
Beta Was this translation helpful? Give feedback.
-
@tcollinsworth AVA 4 works just fine with CJS. Being a Node.js test runner, for ESM support we rely on Node.js' standard behavior.
Originally posted by @novemberborn in #2293 (comment)
@novemberborn Upgrading ava from 3.15.0 to 4.0.1 with esm-wallaby shim for optional-chaining support throws:
Beta Was this translation helpful? Give feedback.
All reactions