Skip to content
New issue

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

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

Already on GitHub? # to your account

Enabling TASK_TEST to be configured in config #591

Open
odanado opened this issue Dec 28, 2020 · 2 comments
Open

Enabling TASK_TEST to be configured in config #591

odanado opened this issue Dec 28, 2020 · 2 comments

Comments

@odanado
Copy link

odanado commented Dec 28, 2020

The task name of hardhat-jest-plugin tests is test:test.
https://github.com/rryter/hardhat-jest-plugin#tasks

The task name of tests of solidity-coverage is hard-coded.

failedTests = await env.run(TASK_TEST, {testFiles: testfiles})

When TASK_TEST can be set in config, solidity-coverage can be used in hardhat-jest-plugin.

@cgewecke
Copy link
Member

Oh, interesting!

You're suggesting an additional option like this?

// .solcover.js
hardhatTestTaskName: <string>

Have you tried this locally? Does noCompile also need to be true?

@odanado
Copy link
Author

odanado commented Dec 28, 2020

You're suggesting an additional option like this?

Yes.

The repository I'm trying is https://github.com/odan-sandbox/erc721-compare-gas-used.
When I run yarn hardhat coverage, the test fails with the following error because the test is run using mocha.

Error in plugin solidity-coverage: ReferenceError: expect is not defined

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

No branches or pull requests

2 participants