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鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
馃悰 Bug: --(f)grep
causes mochaHooks
to not run
#5005
Comments
I initially thought the I searched through the mocha docs, but I couldn't find anything about the actual behaviour, so I think it's a bug. |
Actually, it appears to be all CLI flags passed like |
--(f)grep
causes mockaHooks
to not run--(f)grep
causes mockaHooks
to not run
--(f)grep
causes mockaHooks
to not run--(f)grep
causes mochaHooks
to not run
馃 I can't reproduce this. Using the
Could you provide a standalone reproduction please? |
Prerequisites
faq
labelnode_modules/.bin/mocha --version
(Local) andmocha --version
(Global). We recommend that you not install Mocha globally.Description
When a setup file is specified (
--require './test/mocha.setup.mjs
) that exportsmochaHooks
and--(f)grep
is also specified, the setup file is run butmochaHooks
are ignored.I'm using the setup file (among other things) to set up global module mocks (courtesy of
testdouble
) in a beforeAll. When the mocks are not set, the tests explode (ex IndexedDB doesn't exist in node).Steps to Reproduce
--require
and--(f)grep
(exnpm run test:units -- --fgrep 'example'
--(f)grep
Expected behavior: mochaHooks are run
Actual behavior: mochaHooks are ignored
Reproduces how often: 100%
Versions
mocha --version
andnode_modules/.bin/mocha --version
: 10.2.0node --version
: 18.12.0Additional Information
The text was updated successfully, but these errors were encountered: