hardhat
hardhat copied to clipboard
Test `test` task
We have to tests for the test task. This can be a little tricky to test, so if someone is willing to give it a try, feel free to ping me and we can discuss how to do it.
Hey @alcuadrado , I'd like to contribute.
Maybe we can use the e2e tests to at least smoke test the test task? (Talking about this is so confusing)
@fvictorio I understand that the goal of test task is to:
- load hardhat.config.ts
- Run a development network
- then run external mocha test files
If steps 1 and 2 are been tested individually, we could guarantee the expected when a valid mocha test exists and when it does not. 🤔
What Do You think about it?
There are two possible ways to test this (and I think we should do both):
- Take one of the existing tests under
hardhat-core/test/builtin-tasksand use it as the starting point to test thetesttask. - Use the
e2epackage and add some scenarios for thetesttask.
The problem is what to assert. I think in both cases there should be a fixture project with a single passing test and another project with a single failing test, and then we should assert that they exit with a code of 0 and 1, respectively.
The waffle plugin contains a test that runs the test task internally. I think it can work as inspiration.
Hi! Since this one seems to be stale for a while, can I take it?
I think I can do this.
@alcuadrado is this one still relevant?