refactor tests for the new connection logic

This commit is contained in:
Fred K. Schott
2019-12-27 09:30:30 -08:00
parent 20d3be0d1d
commit e3822e6bc3
9 changed files with 117 additions and 131 deletions

View File

@@ -139,3 +139,15 @@ export function loadTestSuites(): LoadedTestSuite[] {
})
.filter(Boolean)
}
/**
* Ignore WebSocket DisconnectErrors. Useful for making requests where we don't
* care about the response and plan to teardown the test before the response
* has come back.
*/
export function ignoreWebSocketDisconnect(error: Error): void {
if (error.message === 'websocket was closed') {
return
}
throw error
}