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
Hey @RutaTang, thanks for the steps, I was able to reproduce locally.
If you run npx hardhat test test/sample-test.js you will avoid the error. Why the npx hardhat test ./test/sample-test.js formulation errors is an open issue, so I am going to close this issue as a duplicate of #2220.
Using hardhat 2.8.2, when try to run a single file test, "Error: Cannot find module" happens.
I start a new project and error still exists, the following are exactly my steps:
npm init --yes
npm install --save-dev hardhat
npx hardhat
, choose the "Create an advanced sample project" optionnpx hardhat test
, works good and no errornpx hardhat test ./test/sample-test.js
, afetr test cases are completed, an error happens "Error: Cannot find module './test/sample-test.js'"The text was updated successfully, but these errors were encountered: