File tree Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Expand file tree Collapse file tree 1 file changed +2
-10
lines changed Original file line number Diff line number Diff line change @@ -320,7 +320,7 @@ const enabled = !!globalThis.process?.env.SOCKETSERVER_ENABLED;
320320 } ) ;
321321
322322 it ( "cannot send on a disconnect socket (it will never come back)" , async ( ) => {
323- let done ! : ( ( ) => void ) & { fail : ( e ?: any ) => void } ;
323+ let done ! : ( ( p ?: void | PromiseLike < void > ) => void ) & { fail : ( e ?: any ) => void } ;
324324 const ret = new Promise < void > ( ( resolve , reject ) => {
325325 done = resolve as typeof done ;
326326 done . fail = reject ;
@@ -338,15 +338,7 @@ const enabled = !!globalThis.process?.env.SOCKETSERVER_ENABLED;
338338 socket . disconnect ( ) ;
339339 } ,
340340 ( ) => {
341- socket
342- . send ( "la li lu" )
343- . then ( ( ) => {
344- done . fail ( "must not resolve" ) ;
345- } )
346- . catch ( ( error ) => {
347- expect ( error . message ) . toMatch ( / s o c k e t w a s c l o s e d / i) ;
348- done ( ) ;
349- } ) ;
341+ done ( expectAsync ( socket . send ( "la li lu" ) ) . toBeRejectedWithError ( / s o c k e t w a s c l o s e d / i) ) ;
350342 } ,
351343 ) ;
352344 socket . connect ( ) ;
You can’t perform that action at this time.
0 commit comments