We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2d799f8 commit c4e00aaCopy full SHA for c4e00aa
src/pat/tabs/tabs.test.js
@@ -325,9 +325,19 @@ describe("pat-tabs", function () {
325
el.innerHTML = "<div></div>";
326
jest.spyOn(el, "getBoundingClientRect").mockImplementation(() => { return { x: 0, width: 0 }; }); // prettier-ignore
327
328
- pattern.init(el.querySelector("div"));
329
- await utils.timeout(1);
330
- document.body.dispatchEvent(new Event("pat-update"));
331
- expect(pattern).not.toThrow(TypeError);
+ let thrown = false;
+ try {
+ pattern.init(el.querySelector("div"));
+ await utils.timeout(1);
332
+ document.body.dispatchEvent(new Event("pat-update"));
333
334
+ } catch (e) {
335
+ if (e instanceof TypeError) {
336
+ thrown = true;
337
+ } else {
338
+ throw e;
339
+ }
340
341
+ expect(thrown).toBe(false);
342
});
343
0 commit comments