Skip to content
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

Mocha only runs one test #3159

Closed
3 of 4 tasks
javahaxxor opened this issue Dec 14, 2017 · 7 comments
Closed
3 of 4 tasks

Mocha only runs one test #3159

javahaxxor opened this issue Dec 14, 2017 · 7 comments
Labels
status: waiting for author waiting on response from OP - more information needed type: question support question

Comments

@javahaxxor
Copy link

Prerequisites

  • Checked that your issue isn't already filed by cross referencing issues with the common mistake label
  • Checked next-gen ES issues and syntax problems by using the same environment and/or transpiler configuration without Mocha to ensure it isn't just a feature that actually isn't supported in the environment in question or a bug in your code.
  • 'Smoke tested' the code to be tested by running it outside the real test suite to get a better sense of whether the problem is in the code under test, your usage of Mocha, or Mocha itself
  • Ensured that there is no discrepancy between the locally and globally installed versions of Mocha. You can find them with:
    node node_modules/.bin/mocha --version(Local) and mocha --version(Global). We recommend avoiding the use of globally installed Mocha.

Description

Mocha doesn't run all tests, just one

Steps to Reproduce

See the attached screenshots. Neither mocha test/**/*.spec.js nor mocha --recursive work for me

Expected behavior: [What you expect to happen]
all tests in the directory should be executed
Actual behavior: [What actually happens]
Only one test is ran
Reproduces how often: [What percentage of the time does it reproduce?]
100%

Versions

mocha version 4.0.1
I'm getting this error on both OSX and Linux, regardless of globstar settings

Additional Information

I'm wondering if there is a bug. I'm getting this error on both OSX and Linux:
screen shot 2017-12-12 at 18 29 33
screen shot 2017-12-12 at 18 31 32
screen shot 2017-12-12 at 18 33 29

@boneskull boneskull added status: waiting for author waiting on response from OP - more information needed type: question support question labels Dec 14, 2017
@boneskull
Copy link
Contributor

I don't understand which test file(s) aren't executed which are supposed to be. from that first screenshot, it looks like they all might be... but I can't really tell you more without more info about the repo.

you could try removing mocha.opts and see what happens

@ORESoftware
Copy link

could it be an .only call?

@wertlex
Copy link

wertlex commented Mar 8, 2018

Same here.
I made simple example: https://github.com/wertlex/mocha-recursive-issue

Issue is in npm run test-wildcard-recursive. Expected mocha will run tests from both test/admin and test/admin/superadmin, but only first one run.

Looks like mocha ./test/**/*.js --recursive not works as expected.

@wertlex
Copy link

wertlex commented Mar 8, 2018

Found. This problem explained here: #3136
@javahaxxor you just need quotes
@boneskull this issue can be closed

@javahaxxor
Copy link
Author

@wertlex I have quotes ..

@outsideris
Copy link
Contributor

@javahaxxor Can you show your example which has the problem like @wertlex

@boneskull
Copy link
Contributor

@javahaxxor grep for .only in your tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting for author waiting on response from OP - more information needed type: question support question
Projects
None yet
Development

No branches or pull requests

5 participants