You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting this error while trying to run hardhat test:jest on windows.
C:\repos\myProject\contracts>npr contracts:jest
> [email protected] contracts:jest
> hardhat test:jest --no-compile
You have both ethereum-waffle and @nomicfoundation/hardhat-chai-matchers installed. They don't work correctly together, so please make sure you only use one.
We recommend you migrate to @nomicfoundation/hardhat-chai-matchers. Learn how to do it here: https://hardhat.org/migrate-from-waffle
An unexpected error occurred:
Error: Can't find a root directory while resolving a config file path.
Provided path to resolve: C:\Users\Qwerty\repos\myProject\contracts/jest.config.js
cwd: C:\repos\myProject\contracts
at resolveConfigPath (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\node_modules\jest-config\build\resolveConfigPath.js:134:11)
at readConfig (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\node_modules\jest-config\build\index.js:228:49)
at readConfigs (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\node_modules\jest-config\build\index.js:420:32)
at runCLI (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\node_modules\@jest\core\build\cli\index.js:133:29)
at testFailures (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\src\index.ts:20:14)
at new Promise (<anonymous>)
at SimpleTaskDefinition.action (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\src\index.ts:15:32)
at async Environment._runTaskDefinition (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:219:14)
at async Environment.run (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat\src\internal\core\runtime-environment.ts:131:14)
at async SimpleTaskDefinition.action (C:\Users\Qwerty\repos\myProject\contracts\node_modules\hardhat-jest-plugin\src\index.ts:48:28)
(node:49648) ExperimentalWarning: stream/web is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
But then when I run npx jest --showConfig it does read my jest.config.ts correctly, which can be seen from the output:
What I am finding odd is the weird forward slash where it should have been a backwards slash. And then it actually tries to load jest.config.js instead of .ts
Provided path to resolve: C:\Users\Qwerty\repos\myProject\contracts/jest.config.js
What should I do?
The text was updated successfully, but these errors were encountered:
When I tried to change the config.paths.root + "/jest.config.js" by hand to jest.config.ts it didn't really help. It did discover the files, but then I received
FAIL Contracts test/Example.ts
● Test suite failed to run
Jest encountered an unexpected token
Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.
Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.
I am getting this error while trying to run
hardhat test:jest
on windows.But then when I run
npx jest --showConfig
it does read myjest.config.ts
correctly, which can be seen from the output:This is my
jest.config.ts
What I am finding odd is the weird forward slash where it should have been a backwards slash. And then it actually tries to load
jest.config.js
instead of.ts
What should I do?
The text was updated successfully, but these errors were encountered: