Skip to content

Conversation

rndstr
Copy link
Contributor

@rndstr rndstr commented May 13, 2016

At a certain point in my project, npm test started to ignore certain spec files. I don't know enough about npm as to know why this happened but I guess it has to do with how the package.json file is read and how the command is executed (shell, env, user, …).

A fresh react-slingshot checkout works fine.

I fixed it for my project by passing the src/**/*.spec.js argument wrapped in double-quotes (see diff).

For reference, my only spec files:

./src/components/Mui/Row.spec.js
./src/components/Mui/Icon.spec.js
./src/components/Mui/Form/TextInput.spec.js
./src/components/Mui/Form/FormField.spec.js
./src/components/ContinueButtons.spec.js

If I execute mocha tools/testSetup.js src/**/*.spec.js in zsh it works and runs all spec files. If I do npm test (without this PR applied) it only runs ContinueButtons.spec.js. With this PR it runs them all.

@coryhouse coryhouse merged commit 3dfeee7 into coryhouse:master May 13, 2016
@coryhouse
Copy link
Owner

Woot! 💯 Great catch! I solved this issue by adding extra globs for deeper subdirectories but am relieved to see there's an elegant fix for this! Thanks so much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants