Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I need a way to compile contracts before running the tests. #245

Open
migoldfinger opened this issue Jul 3, 2023 · 0 comments
Open

I need a way to compile contracts before running the tests. #245

migoldfinger opened this issue Jul 3, 2023 · 0 comments

Comments

@migoldfinger
Copy link

Hi,

I have a hardhat project with various tests. Some of the tests are sensitive to the way the are compiled.
I have 2 kind of test runs defined in my package.json one runs the tests only, the other on adds code coverage to the tests.
The code coverage tests adds some data to the contracts therefore all tests depending gas costs are failing.
When I run from command line this is no problem because

  1. hardhat test (default) and hardhat test:coverage do compile the contracts before running the tests
  2. hardhat test:coverage is configured to skip gas tests

It seems when I run the tests in mocha test explorer the contracts do not get compiled.
So the result of the tests in the mocha test explorer depends on the test run I did from the command line the last time.
If it was "hardhat test" all tests go green
If it was "hardhat test:coverage" gas tests will fail
That should not be the case, I need a way to ensure that "hardhat test" did run before running the tests in mocha test explorer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant