-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Test runs twice #1327
Comments
your first test needs to use done: it("test 1", function(done) {
process.nextTick(function() {
throw new Error("Too bad");
done();
});
});
it("test 2", function() {});
it("test 3", function(done) {
process.stdout.write("This actually runs twice.\n");
process.nextTick(done.bind({},"OUCH"));
});
|
2014-08-29 23:52 GMT+02:00 Travis Jeffery [email protected]:
Hi Travis, thanks for the quick reply. I arrived to this gist by minimizing a much larger problematic case, and I'll work on the issue next week, but I'll need some time to get up to It's bedtime now in Europe, have a nice evening, Dominique Quatravaux |
Please pull from #1335 for a regression test and a fix. |
…ve a state. Fixes #1327 Closes #1335 Signed-off-by: Joshua Appelman <[email protected]>
Thanks for reporting and fixing this! |
…ve a state. Fixes mochajs#1327 Closes mochajs#1335 Signed-off-by: Joshua Appelman <[email protected]>
This seems to be happening again. |
@DiegoAlberto do you have an example? The regression test for this issue is showing things are fine: #1686 |
Hello, not really sure if this is the same error as the one I'm referring to: Test being run twice on velocity mocha. |
I fixed this in my case by encapsulating my Mocha.run() in the following condition. I'm not sure why it does but...
|
Oooh I get it. |
@rjsteinert - didn't solve the problem for me when running tests though the HTML file in the browser. failed tests still appear twice :( Mocha HTML:
A failed test:
Failed tests shown twice... |
I am experiencing the issue above. Here is a js-fiddle, I am forcing a failing test to showcase that failing tests display twice: https://jsfiddle.net/sgnl/wfyavarf/2/ ^ above example is fixed with mocha 5: https://jsfiddle.net/wfyavarf/9/ |
Duplicate error reports in the browser will be fixed via #2112 |
I'm seeing the test run twice in the browser despite being on Mocha 3.1.2. |
Sorry, my mistake... |
Any resolution for this? |
+1 getting same error. |
Came across this issue while trying to debug an issue I had with an |
@johnslay Thanks for the tip! I'll try it |
It was happening to me due to not passing done and calling it, but could not understand why was it run twice because of this. |
@meetDeveloper this just happened to me as well |
Same failed test ran twice despite having done handled properly: |
I got same issue, I only have one case. |
For me the Glob path for
|
This gist produces the following output, where test 3 runs twice. (It actually does run twice, as can be observed with the
process.stdout.write
s; it's not just a reporting artifact)This looks like it could be related with #660
The text was updated successfully, but these errors were encountered: