Skip to content

Bug Fixing: Mocha doesn't run all test files #5

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 12, 2017

Conversation

m0uneer
Copy link
Contributor

@m0uneer m0uneer commented Feb 20, 2017

Put single quotes around the pattern you pass to Mocha to prevent it being interpreted by your shell: 'src//*.test.js'.
What happens is that, without the quotes, your shell tries to expand that pattern and is successful. The result of expansion is src/some-other-module/some-other-module.test.js and this is what is passed to Mocha.
Before you created that file, the shell still tried to expand the pattern but was not successful and left the pattern as-is. So Mocha got src/
/*.test.js, which Mocha itself interpreted as a glob.
In case you wonder, in Bash, unless the globstar option is turned on, ** is equivalent to *.

Put single quotes around the pattern you pass to Mocha to prevent it being interpreted by your shell: 'src/**/*.test.js'.
What happens is that, without the quotes, your shell tries to expand that pattern and is successful. The result of expansion is src/some-other-module/some-other-module.test.js and this is what is passed to Mocha.
Before you created that file, the shell still tried to expand the pattern but was not successful and left the pattern as-is. So Mocha got src/**/*.test.js, which Mocha itself interpreted as a glob.
In case you wonder, in Bash, unless the globstar option is turned on, ** is equivalent to *.
@mjhea0 mjhea0 merged commit 1d85e89 into mjhea0:master Mar 12, 2017
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.

3 participants