Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(614)

Unified Diff: sdk/lib/_internal/pub/test/transformer/dart2js/does_not_compile_until_its_output_is_requested_test.dart

Issue 139493010: Invoke dart2js lazily when using pub serve. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: sdk/lib/_internal/pub/test/transformer/dart2js/does_not_compile_until_its_output_is_requested_test.dart
diff --git a/sdk/lib/_internal/pub/test/transformer/dart2js/compiles_generated_dart_file_test.dart b/sdk/lib/_internal/pub/test/transformer/dart2js/does_not_compile_until_its_output_is_requested_test.dart
similarity index 52%
copy from sdk/lib/_internal/pub/test/transformer/dart2js/compiles_generated_dart_file_test.dart
copy to sdk/lib/_internal/pub/test/transformer/dart2js/does_not_compile_until_its_output_is_requested_test.dart
index 9d73a053644c600031475df18b295104b76925ad..e71c925b9ea1c7cf6004166499bed85bb9bd4cc1 100644
--- a/sdk/lib/_internal/pub/test/transformer/dart2js/compiles_generated_dart_file_test.dart
+++ b/sdk/lib/_internal/pub/test/transformer/dart2js/does_not_compile_until_its_output_is_requested_test.dart
@@ -1,4 +1,4 @@
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file
+// Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -12,28 +12,27 @@ import '../../serve/utils.dart';
main() {
initConfig();
- integration("compiles a generated Dart file to JS", () {
+ integration("does not compile until its output is requested", () {
d.dir(appPath, [
d.pubspec({
"name": "myapp",
"version": "0.0.1",
- "transformers": ["myapp/transformer"]
}),
- d.dir("lib", [
- d.file("transformer.dart", dartTransformer("munge"))
- ]),
d.dir("web", [
- d.file("main.dart", """
-const TOKEN = "before";
-void main() => print(TOKEN);
-""")
+ d.file("syntax-error.dart", "syntax error")
])
]).create();
createLockFile('myapp', pkg: ['barback']);
- pubServe();
- requestShouldSucceed("main.dart.js", contains("(before, munge)"));
+ var server = pubServe();
+ expect(server.nextLine(),
+ completion(equals("Build completed successfully")));
Bob Nystrom 2014/02/11 19:08:47 This highlights an interesting corner of the user
+
+ // Once we request the output, it should start compiling and fail.
+ requestShould404("syntax-error.dart.js");
+ expect(server.nextLine(),
+ completion(equals("Build completed with 1 errors.")));
endPubServe();
});
}

Powered by Google App Engine
This is Rietveld 408576698