QUnit

@qunitjs.com

The powerful, easy-to-use JavaScript testing framework. Docs: https://qunitjs.com
 Source: https://github.com/qunitjs/qunit #qunit #javascript #typescript #nodejs #tdd #jquery #emberjs

(How I use) Qunit: - testem for cli reporter (not qunit) - (bulilt assets to load (I'd prefer vite's way) - testem for launching pre-installed browsers (doesn't force installation via npm like like puppeteer does, iirc) - qunit for test runner - qunit for test framework

Ever wondered how beforeEach works in a unit test framework? qunitjs.com/lifecycle/ While people generally guess right, this demonstrates that the order is guaranteed, and showcases what's possible when you depend on it. Thanks to FND, Jan D, and NullVoxPopuli for their help! #qunit

Imagine a test with global hooks, and a Parent and Child module that use hooks also. The execution order is:
1. Parent module runs the before hook.
2. Every test in the Parent module inherits context from the before hook, and repeats as follows: call global beforeEach, parent beforeEach, the actual test, parent afterEach, and lastly the global afterEach.
3. The Child module inherits context from the Parent before hook, and then runs its own before hook.
4. Every test in the Child module inherits context from this before hook, and repeats as follows: call global beforeEach, parent beforeEach, child beforeEach, the actual test, child afterEach, parent afterEach, and lastly the global afterEach.