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

hardhat test should support pass-through of mocha arguments #2316

Closed
tmpfs opened this issue Jan 30, 2022 · 7 comments
Closed

hardhat test should support pass-through of mocha arguments #2316

tmpfs opened this issue Jan 30, 2022 · 7 comments
Assignees

Comments

@tmpfs
Copy link

tmpfs commented Jan 30, 2022

In my terminal using the solarized color theme I cannot see the stack trace due to this long-standing issue that nobody wants to resolve. Also see this issue.

Normally I pass --no-color to mocha to bypass this problem but I cannot when executed via hardhat.

I was expecting npx hardhat test -- --no-color to pass the additional options to mocha(1) but it doesn't work.

Currently, I cannot read stack traces. Allowing additional custom mocha options would fix this issue 🙏

@tmpfs
Copy link
Author

tmpfs commented Jan 30, 2022

FYI, I tried adding a .mocharc.json and configuring mocha in package.json but neither appear to work either.

@tmpfs
Copy link
Author

tmpfs commented Jan 30, 2022

Ok, so my workaround for now so that my .mocharc.js file is respected is to call mocha directly rather than hardhat test.

@feuGeneA
Copy link
Contributor

Can you clarify your actual request here? 🙏

@tmpfs
Copy link
Author

tmpfs commented Feb 1, 2022

@feuGeneA, sure, I would like it if we could pass options to the mocha executable when running hardhat test in the standard manner:

hardhat test -- --no-color

Thanks 🙏

@feuGeneA feuGeneA changed the title Cannot disable colors for mocha tests hardhat test should support pass-through of mocha arguments Feb 1, 2022
@lino-silva
Copy link

+1 to this - I want to use custom test reporters (Jenkins), and the arguments are not being passed through to mocha

@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 Jun 10, 2022
@github-actions
Copy link
Contributor

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

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 18, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants