qunitjs / qunit

🔮 An easy-to-use JavaScript unit testing framework.
https://qunitjs.com
MIT License
4.02k stars 783 forks source link

Core: Refactor internal ProcessingQueue into class #1740

Closed Krinkle closed 5 months ago

Krinkle commented 5 months ago

This is motivated by the last remaining build warning from Rollup:

src/qunit.js → qunit/qunit.js... (!) Circular dependency src/test.js -> src/core/processing-queue.js -> src/test.js created qunit/qunit.js in 2s

ProcessingQueue needs access to the test function defined in test.js.

Fix by turning the module into a class, that we create a singleton of in core.js (with access to test.js) and then use that singleton where we previously used ProcessingQueue statically.

Krinkle commented 5 months ago

@izelnakri FYI: You'll want to update qunitx to where it resets the internal ProcessingQueue.finished to reset config.pq.finished instead!