Replies: 1 comment
-
|
AVA doesn't touch |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
So, I'm trying to use ava in a brand new yarn PnP repository: https://github.com/Jym77/ava-test
Just ran
yarn init,yarn set version berry(3.5.0), andyarn add --dev ava(5.2.0).My
package.jsonis:{ "name": "ava-test", "version": "1.0.0", "main": "index.js", "license": "MIT", "private": true, "packageManager": "[email protected]", "devDependencies": { "ava": "^5.2.0" }, "scripts": { "test": "ava" }, "ava": { "environmentVariables": { "NODE_OPTIONS": "" } } }and there is only one file
test/foo.spec.js:When runnig
yarn test, I get the following error:When replacing the ava config by:
(i.e. just changing the name of the variable I'm declaring), the test runs fine.
I do need to reset
NODE_OPTIONSdue to #3148 (and of course running this from a shell where I've pre-unsetNODE_OPTIONSto not get the other error).This seems to be an interaction between yarn PnP virtual directories, and ava reading the
NODE_OPTIONSvariable. I'm not fluent enough in module resolution to dig further.Given that the problem disappears when changing part of ava config, I'm filling this issue with ava, but it might as well be yarn misunderstanding something 🤔
The problem seems to be here both with ava 5.0.0 and 5.2.0. I have another repo with ava 5.1.0 and yarn using
node_modules(not PnP) where theNODE_OPTIONSvariable doesn't break anything.Trying to fool ava by changing:
still gets the error with the
__virtual__path not being found.Calling a side script:
with
in
package.jsonis a workaround…Beta Was this translation helpful? Give feedback.
All reactions