-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding client tests #95
Conversation
@nex3 this adds the tests but some tests fail. On the
On the
For both
Anyways I'd like to land this and fix the issues individually. @kevmoo that means that tests will be failing until the above is resolved. |
test/client_test.dart
Outdated
serverUrl = Uri.parse(await channel.stream.first); | ||
}); | ||
|
||
// HEAD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These headers seem redundant with the groups.
test/client_test.dart
Outdated
}); | ||
|
||
test('readBytes throws an error for a 4** status code', () { | ||
platformClient().readBytes(serverUrl.resolve('/error')).then((_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use async/await.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a specific way I should be using one of the expect
functions? I wasn't able to get it to work otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you figured it out.
test/hybrid/client.dart
Outdated
@@ -0,0 +1,9 @@ | |||
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why this is under a "hybrid" directory.
test/hybrid/server.dart
Outdated
'host', | ||
]; | ||
|
||
hybridMain(StreamChannel channel) async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document this. In particular, mention which tests it's used in and what the server does.
test/client_test.dart
Outdated
}); | ||
|
||
test('readBytes throws an error for a 4** status code', () { | ||
platformClient().readBytes(serverUrl.resolve('/error')).then((_) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you figured it out.
This adds a
dart:html
anddart:io
compatibleClient
test. A server is added for the clients to call.