Consider allowing `null` and `undefined` for doesNotExist
See original GitHub issueConsider the following
assert.dom(findMatching('button', 'Suspend')).doesNotExist('cannot suspend user')
When there is no button (undefined
) this is output:
Expected: "Element div#ember-testing.ember-application[data-ol-has-click-handler] does not exist"
Result: "Element div#ember-testing.ember-application[data-ol-has-click-handler] exists once"
It also means I have to bypass qunit dom, like this:
assert.dom(findMatching('button', 'Restore')).exists('can restore user')
assert.ok(!findMatching('button', 'Suspend'), 'cannot suspend user')
…I see there are tests for this exact scenario, but I wonder if you would consider changing it?
Issue Analytics
- State:
- Created 3 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Is there a way to check for both `null` and `undefined`?
Using a juggling-check, you can test both null and undefined in one hit: if (x == null) {. If you use a strict-check,...
Read more >Handling null and undefined in JavaScript | by Eric Elliott
In some statically typed languages, you can say that null and undefined are illegal values, and let your programming language throw a TypeError ......
Read more >7 Tips to Handle undefined in JavaScript
A detailed article about 'undefined' keyword in JavaScript. 7 tips on how to handle correctly 'undefined' and increase code durability.
Read more >Optional chaining (?.) - JavaScript - MDN Web Docs - Mozilla
If the object accessed or function called is undefined or null, it returns undefined instead of throwing an error.
Read more >Documentation - TypeScript 3.7
You can think of this feature - the ?? operator - as a way to “fall back” to a default value when dealing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Opened https://github.com/simplabs/qunit-dom/issues/736 to track this potential false positive.
Thank you for reporting it 👍
Thanks. That’s not something I want to use. No problem if you want to close the issue