Chromium Code Reviews| Index: sdk/lib/_internal/pub/test/serve/prints_a_transform_error_in_apply.dart |
| diff --git a/sdk/lib/_internal/pub/test/serve/prints_a_transform_error_in_apply.dart b/sdk/lib/_internal/pub/test/serve/prints_a_transform_error_in_apply.dart |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5988f7b675b6cc0ea7f8585869dbc588ca248325 |
| --- /dev/null |
| +++ b/sdk/lib/_internal/pub/test/serve/prints_a_transform_error_in_apply.dart |
| @@ -0,0 +1,50 @@ |
| +// Copyright (c) 2013, 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. |
| + |
| +library pub_tests; |
| + |
| +import '../descriptor.dart' as d; |
| +import '../test_pub.dart'; |
| +import 'utils.dart'; |
| + |
| +main() { |
| + initConfig(); |
| + integration("prints a transform error in apply", () { |
| + var transformer = """ |
|
Bob Nystrom
2013/08/27 22:12:30
Can you move this to the top-level just so that th
nweiz
2013/08/28 20:45:23
Done.
|
| +import 'dart:async'; |
| + |
| +import 'package:barback/barback.dart'; |
| + |
| +class RewriteTransformer extends Transformer { |
| + RewriteTransformer(); |
| + |
| + String get allowedExtensions => '.txt'; |
| + |
| + Future apply(Transform transform) => throw new Exception('oh no!'); |
| +} |
| +"""; |
| + |
| + d.dir(appPath, [ |
| + d.pubspec({ |
| + "name": "myapp", |
| + "transformers": ["myapp/src/transformer"] |
| + }), |
| + d.dir("lib", [d.dir("src", [ |
| + d.file("transformer.dart", transformer) |
| + ])]), |
| + d.dir("web", [ |
| + d.file("foo.txt", "foo") |
| + ]) |
| + ]).create(); |
| + |
| + createLockFile('myapp', {}, pkg: ['barback']); |
| + |
| + var server = startPubServe(); |
| + expect(server.nextLine(), completion(equals('Build error:'))); |
|
Bob Nystrom
2013/08/27 22:12:30
Would be great to include the name of the transfor
nweiz
2013/08/28 20:45:23
It turns out this test wasn't actually getting run
|
| + expect(server.nextLine(), completion(equals('| oh no!'))); |
| + expect(server.nextLine(), completion(isEmpty)); |
| + expect(server.nextLine(), completion(equals('Stack trace:'))); |
| + endPubServe(); |
| + }); |
| +} |