Skip to content

Commit 73421ae

Browse files
committed
test: modify test to verify behavior of empty response exception
1 parent 20b2c52 commit 73421ae

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

packages/gotrue/test/client_test.dart

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -484,8 +484,11 @@ void main() {
484484
try {
485485
await client.signInWithPassword(email: email1, password: password);
486486
} catch (error) {
487-
expect(error, isA<AuthException>());
488-
expect((error as AuthException).statusCode, '420');
487+
expect(error, isA<AuthUnknownException>());
488+
error as AuthUnknownException;
489+
expect(error.statusCode, '420');
490+
expect(error.originalError, isA<http.Response>());
491+
expect(error.message, contains('empty response'));
489492
}
490493
});
491494
});

packages/gotrue/test/custom_http_client.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class CustomHttpClient extends BaseClient {
1010
Future<StreamedResponse> send(BaseRequest request) async {
1111
//Return custom status code to check for usage of this client.
1212
return StreamedResponse(
13-
request.finalize(),
13+
Stream.empty(),
1414
420,
1515
request: request,
1616
);

0 commit comments

Comments
 (0)