Looking at the docs for asyncTest and stop , there are two reasons why I can understand that it is configured like this.
- So that you do not accidentally run two tests at the same time, which could conflict with something (i.e. modify the DOM and thereby change the test results of each other).
- So QUnit knows when the tests will end. If it comes to the end of all synchronous tests, then they will record results that you really do not want if asynchronous tests still occur in the background.
So, thatβs good, and you probably donβt really want asynchronous tests to block when they run. Perhaps you could do this by invoking start
immediately after running your asynchronous tests, but remember that JavaScript is actually single-threaded (although it does multithread sometimes), so this may lead to unexpected results, since you cannot guarantee that your asynchronous test will continue to work ... it may not be (maybe not) until the other tests are complete and the results are published.
source share