File tree Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Expand file tree Collapse file tree 1 file changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -325,9 +325,19 @@ describe("pat-tabs", function () {
325325 el . innerHTML = "<div></div>" ;
326326 jest . spyOn ( el , "getBoundingClientRect" ) . mockImplementation ( ( ) => { return { x : 0 , width : 0 } ; } ) ; // prettier-ignore
327327
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 ) ;
328+ let thrown = false ;
329+ try {
330+ pattern . init ( el . querySelector ( "div" ) ) ;
331+ await utils . timeout ( 1 ) ;
332+ document . body . dispatchEvent ( new Event ( "pat-update" ) ) ;
333+ await utils . timeout ( 1 ) ;
334+ } catch ( e ) {
335+ if ( e instanceof TypeError ) {
336+ thrown = true ;
337+ } else {
338+ throw e ;
339+ }
340+ }
341+ expect ( thrown ) . toBe ( false ) ;
332342 } ) ;
333343} ) ;
You can’t perform that action at this time.
0 commit comments