aboutsummaryrefslogtreecommitdiff
path: root/test/jsdom.test.js
diff options
context:
space:
mode:
authortoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-29 22:06:38 -0500
committertoasted-nutbread <toasted-nutbread@users.noreply.github.com>2023-11-29 22:06:38 -0500
commit01142ef3d62e388a1c952ad9ea3a01ed38b518b6 (patch)
tree0ab39a1457d6c0c13c61d19cec0c3766a9125079 /test/jsdom.test.js
parentf0c5ef69ca1758d5ef9201bc8a4375e5933888be (diff)
Update types
Diffstat (limited to 'test/jsdom.test.js')
-rw-r--r--test/jsdom.test.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/jsdom.test.js b/test/jsdom.test.js
index c53f374e..6c2e00ee 100644
--- a/test/jsdom.test.js
+++ b/test/jsdom.test.js
@@ -26,20 +26,25 @@ import {expect, test} from 'vitest';
*/
function testJSDOMSelectorBug() {
test('JSDOMSelectorBug', () => {
- // nwsapi is used by JSDOM
+ // nwsapi is used by JSDOM
const dom = new JSDOM();
const {document} = dom.window;
const div = document.createElement('div');
div.innerHTML = '<div class="b"><div class="c"></div></div>';
const c = div.querySelector('.c');
- expect(() => c.matches('.a:nth-last-of-type(1) .b .c')).not.toThrow();
+ expect(() => {
+ if (c === null) { throw new Error('Element not found'); }
+ c.matches('.a:nth-last-of-type(1) .b .c');
+ }).not.toThrow();
});
}
+/** */
export function testJSDOM() {
testJSDOMSelectorBug();
}
+/** */
function main() {
testJSDOM();
}