Skip to content

Commit 9904a05

Browse files
committed
Fix http.testing docs example
Fixed syntax errors (two closing parentheses were missing) and return type of function literal. The sample code was formatted with `dartfmt`.
1 parent 15d1b6b commit 9904a05

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

lib/testing.dart

+8-7
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,15 @@
1111
/// import 'dart:convert';
1212
/// import 'package:http/testing.dart';
1313
///
14-
/// var client = new MockClient((request) {
14+
/// var client = new MockClient((request) async {
1515
/// if (request.url.path != "/data.json") {
1616
/// return new Response("", 404);
1717
/// }
18-
/// return new Response(JSON.encode({
19-
/// 'numbers': [1, 4, 15, 19, 214]
20-
/// }, 200, headers: {
21-
/// 'content-type': 'application/json'
22-
/// });
23-
/// };
18+
/// return new Response(
19+
/// JSON.encode({
20+
/// 'numbers': [1, 4, 15, 19, 214]
21+
/// }),
22+
/// 200,
23+
/// headers: {'content-type': 'application/json'});
24+
/// });
2425
export 'src/mock_client.dart';

0 commit comments

Comments
 (0)