kentcdodds / kcd-scripts

CLI toolbox for common scripts for my projects
http://npm.im/kcd-scripts
MIT License
885 stars 207 forks source link

[pre-commit] Fails when passing environment to test script #105

Open MichaelDeBoey opened 4 years ago

MichaelDeBoey commented 4 years ago

When having your test script with a set environment (--env=jsdom) as we have with geniejs, the pre-commit script will fail as this will run kcd-scripts test --findRelatedTests and doesn't take these extra variables into account

"test": "kcd-scripts test --env=jsdom",

https://github.com/kentcdodds/genie/blob/b2aec0a8ea9bf1a0d85fead0427dcb1a1dcee7c8/package.json#L26

kentcdodds commented 4 years ago

I'm not sure how to fix this generally, but I'd suggest just making geniejs have a custom jest config to set the env manually.