qunitjs / qunit

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

Test: Add more tests for test context in module scope and inheritence #1770

Closed Krinkle closed 3 weeks ago

Krinkle commented 3 weeks ago

Use separate properties to be able to distinguish between own and inherited ones. When "appending" to a property, it effectively copies it do the own object, making it hard to notice whether the properties of a parent module really are copied/preserved at each step, vs only visible at step 1 where it copies it thus masking later bugs where we might forget to extend/mixin the parent env.

Also add a test for the module scope callback's context object.

Ref https://github.com/qunitjs/qunit/pull/1762.