-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
154 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { expect } from 'vitest'; | ||
import { Connection, Transport } from '../../transport'; | ||
import { Server } from '../../router'; | ||
|
||
export function ensureTransportIsClean(t: Transport<Connection>) { | ||
expect(t.state, 'transport should be closed after the test').to.not.equal( | ||
'open', | ||
); | ||
expect( | ||
t.connections, | ||
'transport should not have open connections after the test', | ||
).toStrictEqual(new Map()); | ||
expect( | ||
t.messageHandlers, | ||
'transport should not have open message handlers after the test', | ||
).toStrictEqual(new Set()); | ||
expect( | ||
t.sendQueue, | ||
'transport should not have any messages its waiting to send after the test', | ||
).toStrictEqual(new Map()); | ||
return true; | ||
} | ||
|
||
export function ensureServerIsClean(s: Server<unknown>) { | ||
expect( | ||
s.streams, | ||
'server should not have any open streams after the test', | ||
).toStrictEqual(new Map()); | ||
return true; | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.