qunit icon indicating copy to clipboard operation
qunit copied to clipboard

Restart all test without reload page

Open Gorash opened this issue 8 years ago • 3 comments

What are you trying to do?

It would be interesting to be able to restart the tests without reload. To use tests to find on memory leak, or that applications are idempotent, running twice would be useful.

If we try to call start() when all tests are finished we receive an error: "Called start() while test already started running"

Gorash avatar May 08 '17 11:05 Gorash

This is an interesting idea, but I am unsure if it is something we would want to support as a core part of QUnit.

In short, I think it would require a non-trivial amount of code and I imagine it is difficult to get much useful information out of rerunning and entire test suite. If you're focusing on a single test, it may be beneficial, but in those cases I would recommend just wrapping the test in a loop.

trentmwillis avatar May 27 '17 05:05 trentmwillis

Thanks, but the idea of loop is not really possible in my case, I have more than 600 tests (more than 3000 assert) made by different developer in modules of a web application with lasy imports of library. Since some import are lazy, it is necessary to check that their data are very clean (without memory leak, or alteration) and that even between the different tests.

Currently I check the memory leak and globals with the console of the chrome dev tools to do the restart but it is not usefull (save tests list in temporary var, and when start twice make break point, slice the list, remove throw, clear test info, remove break point).

Gorash avatar May 29 '17 08:05 Gorash

I would also like this!

During development inside storybook for example, a file change causes a 'reload'. For the simple elements we have basic unit tests, restarting them would help us speed up development.

reno1979 avatar Jan 15 '21 19:01 reno1979