File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -556,12 +556,13 @@ describe("MatchPage queued human vs human", () => {
556556 expect ( openPersistedGameSocketMock ) . toHaveBeenCalled ( ) ;
557557 } ) ;
558558
559- if ( wsEventHandler === null ) {
559+ if ( typeof wsEventHandler !== "function" ) {
560560 throw new Error ( "Expected websocket handler to be initialized." ) ;
561561 }
562+ const handleWsEvent = wsEventHandler as ( event : PersistedGameWsEvent ) => void ;
562563
563564 const staleBoardAfter = createInitialBoard ( ) ;
564- wsEventHandler ( {
565+ handleWsEvent ( {
565566 type : "game.move.applied" ,
566567 game_id : "game-h2h" ,
567568 move : {
@@ -616,13 +617,14 @@ describe("MatchPage queued human vs human", () => {
616617 expect ( openPersistedGameSocketMock ) . toHaveBeenCalled ( ) ;
617618 } ) ;
618619
619- if ( wsEventHandler === null ) {
620+ if ( typeof wsEventHandler !== "function" ) {
620621 throw new Error ( "Expected websocket handler to be initialized." ) ;
621622 }
623+ const handleWsEvent = wsEventHandler as ( event : PersistedGameWsEvent ) => void ;
622624
623625 const boardAfter = createInitialBoard ( ) ;
624626 boardAfter . half_moves = 1 ;
625- wsEventHandler ( {
627+ handleWsEvent ( {
626628 type : "game.move.applied" ,
627629 game_id : "game-h2h" ,
628630 move : {
You can’t perform that action at this time.
0 commit comments