mainmatter / qunit-dom

High Level DOM Assertions for QUnit
MIT License
179 stars 123 forks source link

Tighter null checks #2107

Closed bendemboski closed 4 months ago

bendemboski commented 5 months ago

While looking over #2101 I noticed a bug that it introduced when matchesSelector() or doesNotMatchSelector() are run on a null target, so this PR extends the test coverage to include a null target for those assertions as well as all the others that didn't already test that case.

Having strictNullChecks enabled also would have caught the bug, and the project was pretty close to being able to enable them, so I made some changes to allow it.

I'm happy to split these out into separate PRs if desired, or change this syntax if we don't like nested terniary operators 😄