You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem or a nice-to-have?? Please describe.
I've been working with sequelize lately and it's awkward to grep for tests in their repo. Here are some of their package scripts:
"test-docker": "npm run test-docker-unit && npm run test-docker-integration",
"test-docker-unit": "npm run test-unit",
"test-docker-integration": "env-cmd $npm_package_options_env_cmd npm run test-integration",
"test-integration": "mocha --require scripts/mocha-bootload --globals setImmediate,clearImmediate --exit --check-leaks --colors -t 30000 --reporter spec \"test/integration/**/*.test.js\"",
"test-integration-postgres": "cross-env DIALECT=postgres npm run test-integration",
Grepping for tests is a hassle because
I have to use a variable number of --, like npm run test-docker-integration -- -- --grep foo, depending on the script, to pass --grep to the actual mocha command. yarn doesn't have this problem if you use yarn instead of npm run in the package scripts, but I don't control that.
npm run test-docker -- -- --grep foo would only apply the --grep to the test-docker-integration script, not to the test-docker-unit script.
Describe the solution you'd like
If I could just do MOCHA_GREP=foo npm run test-docker it would be a lot easier.
Describe alternatives you've considered
I'm planning to PR some additional scripts to their repo for grepping tests, but I'm sure sequelize isn't the only repo that makes grepping difficult like this, so I'd rather have a quick and easy way to do it for future projects I may work on.
The text was updated successfully, but these errors were encountered:
I guess that's true...it would be a bit more of a hassle to change the grep and avoid committing the file to the repo than if I could just use an environment variable though
I don't agree to add MOCHA_GREP. Because if we support mocha flags with environment variable, we should support all flags with environment variable rather than only --grep.
It makes hard to maintain mocha's flags.
yargs has a feature that supports setting options via an environment variable; we should probably take advantage of that at some point. Might even be an issue for it already.
Is your feature request related to a problem or a nice-to-have?? Please describe.
I've been working with
sequelize
lately and it's awkward to grep for tests in their repo. Here are some of their package scripts:Grepping for tests is a hassle because
--
, likenpm run test-docker-integration -- -- --grep foo
, depending on the script, to pass--grep
to the actualmocha
command.yarn
doesn't have this problem if you useyarn
instead ofnpm run
in the package scripts, but I don't control that.npm run test-docker -- -- --grep foo
would only apply the--grep
to thetest-docker-integration
script, not to thetest-docker-unit
script.Describe the solution you'd like
If I could just do
MOCHA_GREP=foo npm run test-docker
it would be a lot easier.Describe alternatives you've considered
I'm planning to PR some additional scripts to their repo for grepping tests, but I'm sure
sequelize
isn't the only repo that makes grepping difficult like this, so I'd rather have a quick and easy way to do it for future projects I may work on.The text was updated successfully, but these errors were encountered: