I'm using WebStorm 2017.2.2 to develop and run some mocha
tests.
All is going pretty well, but the tests never finish. It gets done with running all of my test files, then just sits there spinning saying "Running Tests."
If I hover over the red box, it shows a tooltip that says: Stop 'Full Tests' (
⌘F2)
. It also shows "Stop Process" at the bottom of the IDE. So, I click it, and the red box turns into a skull.
Now, if I hover over the skull, it shows a tooltip that says: Stop 'Full Tests' (
⌘F2)
(same as before). It also shows "Kill Process" (different) at the bottom of the IDE. So, I click it, and the IDE stops saying "Running Tests" and now says "Test Results."
How do I configure WebStorm so that it automatically ties up those loose ends when it reaches the end of my test suite?
Steps to Reproduce Run with mocha --timeout 1000000 test. js. Do not wait until the test finishes and press Ctrl+C to terminate it.
Mocha is a feature-rich JavaScript test framework running on Node. js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases.
There cases when you need to perform asynchronous operations before any suites are run, in such case you may want to delay the root suite. You should run mocha with the -delay flag. This attaches to the global context, a special callback function, run(). A pending test is a test that does not have a callback.
To answer this, the mocha docs state that autoexit is not a feature in v4, basically something is stopping the tests from exiting, to revert back to the v3+ way of exiting when your tests pass, use the arg --exit in your test configs under Extra mocha options
https://boneskull.com/mocha-v4-nears-release/#mochawontforceexit
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With