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

Remove mocha from hardhat-core #2455

Open
fvictorio opened this issue Mar 4, 2022 · 6 comments
Open

Remove mocha from hardhat-core #2455

fvictorio opened this issue Mar 4, 2022 · 6 comments
Labels
status:ready This issue is ready to be worked on type:epic A bigger effort that involves multiple issues and PRs

Comments

@fvictorio
Copy link
Member

We want to remove Mocha from hardhat-core. Users should be able to just install and require a plugin (e.g., @nomiclabs/hardhat-mocha) to have the same functionality that they have now.

Since this is a breaking change, we should do it in two phases.

Phase 1: create plugin and add warning

First we should create and publish that plugin, and change the default test task so that it prints a warning after finishing, saying something like: "The default test task is deprecated, please install and use <plugin-name>"

The plugin would override the test task with the same implementation we have now, and without calling runSuper. That way the behavior wouldn't change, but the warning wouldn't be shown.

Phase 2: remove default implementation and throw an error in the test task

After some time (~2 months) we should remove the dependency on mocha and change the default task to just throw an error indicating users to install hardhat-mocha.

Other considerations

I'm not sure what this means for plugins. For example, I think this would break hardhat-gas-reporter if the plugin is required before the hardhat-mocha plugin.

@alcuadrado
Copy link
Member

I'm not sure what this means for plugins. For example, I think this would break hardhat-gas-reporter if the plugin is required before the hardhat-mocha plugin.

We need to let plugin authors know that they must explicitly depend on hardhat-mocha if they were implicitly depending on mocha. This should be done during Phase 1

@github-actions
Copy link
Contributor

This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the Stale label Apr 29, 2022
@fvictorio
Copy link
Member Author

Relevant.

@github-actions github-actions bot removed the Stale label Apr 30, 2022
@github-actions
Copy link
Contributor

This issue was marked as stale because it didn't have any activity in the last 30 days. If you think it's still relevant, please leave a comment indicating so. Otherwise, it will be closed in 7 days.

@github-actions github-actions bot added the Stale label May 30, 2022
@github-actions
Copy link
Contributor

github-actions bot commented Jun 6, 2022

This issue was closed because it has been stalled for 7 days with no activity.

@github-actions github-actions bot closed this as completed Jun 6, 2022
@alcuadrado alcuadrado reopened this Jun 7, 2022
@alcuadrado alcuadrado added not-stale and removed Stale labels Jun 7, 2022
@niconiahi
Copy link

it would be a really nice feature to have. I would like to integrate with my already in use vitest package

@fvictorio fvictorio added type:epic A bigger effort that involves multiple issues and PRs status:ready This issue is ready to be worked on and removed not-stale labels Dec 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status:ready This issue is ready to be worked on type:epic A bigger effort that involves multiple issues and PRs
Projects
Status: No status
Development

No branches or pull requests

3 participants