Skip to content
Snippets Groups Projects
Commit 7acbcb71 authored by nweiz@google.com's avatar nweiz@google.com Committed by Natalie Weizenbaum
Browse files

Fix dart2js tests in pub.

Pub's [requestShouldSucceed] test helper didn't verify that the
request returned a 200 response, which was masking some issues.

R=rnystrom@google.com

Review URL: https://codereview.chromium.org//704053002

git-svn-id: https://dart.googlecode.com/svn/branches/bleeding_edge@41541 260f80e4-7a28-3924-810f-c04153c831b5
parent 5f5f7708
No related branches found
No related tags found
No related merge requests found
...@@ -24,7 +24,7 @@ import 'asset_environment.dart'; ...@@ -24,7 +24,7 @@ import 'asset_environment.dart';
/// The set of all valid configuration options for this transformer. /// The set of all valid configuration options for this transformer.
final _validOptions = new Set<String>.from([ final _validOptions = new Set<String>.from([
'commandLineOptions', 'checked', 'csp', 'minify', 'verbose', 'environment', 'commandLineOptions', 'checked', 'csp', 'minify', 'verbose', 'environment',
'analyzeAll', 'preserveUris', 'suppressWarnings', 'suppressHints', 'preserveUris', 'suppressWarnings', 'suppressHints',
'suppressPackageWarnings', 'terse' 'suppressPackageWarnings', 'terse'
]); ]);
......
...@@ -15,7 +15,10 @@ main() { ...@@ -15,7 +15,10 @@ main() {
"transformers": [{ "transformers": [{
"\$dart2js": {"minify": true} "\$dart2js": {"minify": true}
}] }]
}) }),
d.dir("web", [
d.file("main.dart", "void main() => print('Hello!');")
])
]).create(); ]).create();
pubServe(); pubServe();
......
...@@ -22,14 +22,16 @@ main() { ...@@ -22,14 +22,16 @@ main() {
"minify": true, "minify": true,
"verbose": true, "verbose": true,
"environment": {"name": "value"}, "environment": {"name": "value"},
"analyzeAll": true,
"suppressWarnings": true, "suppressWarnings": true,
"suppressHints": true, "suppressHints": true,
"suppressPackageWarnings": false, "suppressPackageWarnings": false,
"terse": true "terse": true
} }
}] }]
}) }),
d.dir("web", [
d.file("main.dart", "void main() => print('Hello!');")
])
]).create(); ]).create();
// None of these options should be rejected, either by pub or by dart2js. // None of these options should be rejected, either by pub or by dart2js.
......
...@@ -260,6 +260,7 @@ Future<http.Response> scheduleRequest(String urlPath, {String root}) { ...@@ -260,6 +260,7 @@ Future<http.Response> scheduleRequest(String urlPath, {String root}) {
/// [headers] may be either a [Matcher] or a map to match an exact headers map. /// [headers] may be either a [Matcher] or a map to match an exact headers map.
void requestShouldSucceed(String urlPath, expectation, {String root, headers}) { void requestShouldSucceed(String urlPath, expectation, {String root, headers}) {
scheduleRequest(urlPath, root: root).then((response) { scheduleRequest(urlPath, root: root).then((response) {
expect(response.statusCode, equals(200));
if (expectation != null) expect(response.body, expectation); if (expectation != null) expect(response.body, expectation);
if (headers != null) expect(response.headers, headers); if (headers != null) expect(response.headers, headers);
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment