Closed bhvngt closed 2 years ago
By design, Wallaby reports console.error
messages that are logged during the execution of a test as an error.
In your case, when you use fetch
for the first time, node reports the fetch usage as an error. You can disable this behavior using the node flag, --no-warnings
. Please change the env
runner params of your Wallaby configuration to fix your problem:
wallaby.cjs
...
return {
...
env: {
type: "node",
params: {
runner: "--no-warnings --experimental-specifier-resolution=node --experimental-json-modules --experimental-loader " + require('path').join(__dirname, 'loader.js')
},
"DOTENV_CONFIG_PATH": ".env"
},
...
};
};
Issue description or question
I have been using fetch api using node
18.2.0
. Recently, I have been facing this weird issue. Where the very first test in a test file where fetch API is getting called is failed by wallabyjs. Subsequent tests gets passed by the tool. Here's screenshot with the reproduction.Here's the link to the repo that sort of mimics my project structure and where I could reproduce this issue.
Wallaby diagnostics report