-
-
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
Running the test suite twice skips tests that were already required #736
Comments
I know it's somewhat of an edge case, but at least maybe something should be added to the documentation to explain that behavior. |
hmm yeah that's not good, I'll try and look into this soon and see where the state is at |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 ... Use case: we are trying to do this in order to run mocha multiple times in a grunt task, against different webdriver configurations |
+1, any progress with this ? |
+1 this would be really useful. Running mocha tests on a backend but when I click a button on the frontend to redo the tests, it refuses because of caching. |
+1 |
I think it is really easy to miss the workaround in the original post, this seems to work for me... To add a file programmatically:
Basically, every time you add a test to your |
@boneskull Yes, @1999's solution does work for me. 👍 |
Do I read the PRs correctly so this should work when v3.1 is released...? 92f0248#diff-aa849a970cef551664c12f04a4209f6fR354 Will this be called automatically? Can I run the test suites in parallel? (E.g. it looks like most people in this issue try to run one Mocha test suite multiple times for different browsers in Selenium/Sauce Labs/etc..) |
Probably mocha-parallel-tests is what you need? |
I am a bot that watches issues for inactivity. |
not stale |
Weird, I am getting proper (error) output the first time it runs, second time it runs in the same context I get 0 passing like nothing is running. |
@megamindbrian Sounds like a variation on #2906. |
Oh looks like it could be, thank you for finding it!
…On Tue, Nov 7, 2017 at 12:10 AM, Scott Santucci ***@***.***> wrote:
@megamindbrian <https://github.com/megamindbrian> Sounds like a variation
on #2906 <#2906>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#736 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AX5Xbpz8tXHTb8lQCDVzZPD0LdJIWWAFks5s0AJKgaJpZM4AYZE->
.
--
CONFIDENTIALITY NOTICE: The contents of this email message and any
attachments are intended solely for the addressee(s) and may contain
confidential and/or privileged information and may be legally protected
from disclosure. It is then shared with tech companies, bots, hackers,
government agencies, and marketers. The security of this message is none,
and it may be shared on Instagram at anytime. If you are OK with this,
please respond. There isn't really any security or privacy anywhere. If
you disagree you may want to go camping and talk to people face-to-face
like in old times.
|
+1, any progress with this ? |
1 similar comment
+1, any progress with this ? |
Closing as believe it is now fixed (#4234) |
I wanted to run the test suite twice against different browsers on Saucelabs. I'm using the technique to run mocha programatically but on the second run mocha would always report that it did not run any tests.
After a lot of digging around it seems that since mocha uses require() to load the test files, they get cached and if they're cached they're not added to the suite.
I can manually clear all the tests from the require cache, but I'm wondering if maybe mocha shouldn't do this by default?
This is a simplified example of what I end up doing for it to work:
The text was updated successfully, but these errors were encountered: