Assertion error: something relative to module resolution #3120
Unanswered
SimTheFool
asked this question in
Q&A
Replies: 1 comment 2 replies
-
It looks like a copy of AVA may be included in your build. That doesn't work, the version of AVA imported by your test file needs to be the same as what the AVA CLI loaded into the worker thread / child process. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello !
I'm trying to launch tests on some pre-compiled and bundled test files (I know it's unusual but I needed that way). I'm building my project with esbuild and I'm on
"ava": "^4.3.3"
. I've set my package.json type to module, for convenience. I'm onnode v16
.When launching the compiled tests, I'm having some issue where node is telling me I should use .cjs file if I want to resolve
require("path")
used by ava. But when I do so (changing my compiled files to.cjs
, I get the following error:So I tried another way. I'm keeping my extension to
.js
, but I'm erasing the defaultrequire
at compile time, to get it fromimport
. The still issue persists.--- Additional infos ---
Here is my esbuild config in case the issu comes from compilation. I'm switching the two last entries to try both solution I explained.
And here is my package.json:
Also, I'm using yarn workspace. Here is my repo: https://github.com/SimTheFool/FellSeal-Builder. (I created a specific branch issue/ava-on-compiled-tests-01 so I can continue s I can continue to work without changing the specific repo state that triggered the issue).
Thanks for any help you can provide ;)
Beta Was this translation helpful? Give feedback.
All reactions