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
The long version: I have a hardhat project with foundry, I followed instructions in both foundrybook and hardhat docs and things were going well after I removed the contract and the test Lock.sol, Lock.ts the tests stopped working and started giving 0 passing.
After I found the cause (I didn't know removing lock.ts is the cause at first ), I made a simple hardhat project with my contract and test and I was able to reproduce the bug when I remove the test lock.ts .
Minimal reproduction steps
Create a simple TS hardhat project, add any contract with test then remove the test for Lock.ts .
You don't need to debug this I found the main cause
In my Token.ts I was using async with the first describe which caused no test to be really executed before the program exits...
and when having the Lock.ts test this gives the execution enough time to run the Async tests to give the results.
Solution:
To solve this I just need to remove the async from the main describe statement and fix any following-up errors by removing it.
This is a native JS behavior and not a hardhat bug, So I will close it as it doesn't require any further actions from your side.
Version of Hardhat
2.18.0
What happened?
The long version: I have a hardhat project with foundry, I followed instructions in both foundrybook and hardhat docs and things were going well after I removed the contract and the test Lock.sol, Lock.ts the tests stopped working and started giving 0 passing.
After I found the cause (I didn't know removing lock.ts is the cause at first ), I made a simple hardhat project with my contract and test and I was able to reproduce the bug when I remove the test lock.ts .
Minimal reproduction steps
Create a simple TS hardhat project, add any contract with test then remove the test for Lock.ts .
You can also just clone the repo that has this issue and try to run the test with and without the Lock.ts test
https://github.com/0x0OZ/freeflow-taxableToken/tree/0c74903012bb0ecefc68568fd693787917817c5f
Search terms
hardhat test passing zero / fix hardhat test / hardhat test doesn't run
The text was updated successfully, but these errors were encountered: