diff options
author | Darius Jahandarie <djahandarie@gmail.com> | 2023-12-06 03:53:16 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-06 03:53:16 +0000 |
commit | bd5bc1a5db29903bc098995cd9262c4576bf76af (patch) | |
tree | c9214189e0214480fcf6539ad1c6327aef6cbd1c /test/jsdom.test.js | |
parent | fd6bba8a2a869eaf2b2c1fa49001f933fce3c618 (diff) | |
parent | 23e6fb76319c9ed7c9bcdc3efba39bc5dd38f288 (diff) |
Merge pull request #339 from toasted-nutbread/type-annotations
Type annotations
Diffstat (limited to 'test/jsdom.test.js')
-rw-r--r-- | test/jsdom.test.js | 9 |
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(); } |