Skip to content

Fix http.testing doc example #37

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

Merged
merged 1 commit into from
Jul 6, 2016

Conversation

chalin
Copy link
Contributor

@chalin chalin commented Jun 16, 2016

Fixed:

  • Syntax errors (two closing parentheses were missing)
  • Return type of function literal

The sample code was formatted with dartfmt.

cc @kwalrath

Fixed syntax errors (two closing parentheses were missing) and return
type of function literal. The sample code was formatted with `dartfmt`.
@kwalrath
Copy link

Thanks for fixing this, Patrice! I'll leave the review to @nex3...

@@ -11,14 +11,15 @@
/// import 'dart:convert';
/// import 'package:http/testing.dart';
///
/// var client = new MockClient((request) {
/// var client = new MockClient((request) async {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it needs to be async, but @nex3 would know better.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't type check otherwise. The expected type of the constructor argument is

typedef Future<Response> MockClientHandler(Request request);

@nex3 nex3 merged commit 77d9e87 into dart-lang:master Jul 6, 2016
@chalin chalin deleted the chalin-testing-doc-update-0615 branch July 6, 2016 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants