| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS d.file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Dart2js can take a long time to compile dart code, so we increase the timeout | 5 // Dart2js can take a long time to compile dart code, so we increase the timeout |
| 6 // to cope with that. | 6 // to cope with that. |
| 7 @Timeout.factor(3) | 7 @Timeout.factor(3) |
| 8 | 8 |
| 9 import 'package:pub/src/exit_codes.dart' as exit_codes; | 9 import 'package:pub/src/exit_codes.dart' as exit_codes; |
| 10 import 'package:scheduled_test/scheduled_test.dart'; | 10 import 'package:scheduled_test/scheduled_test.dart'; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 RewriteTransformer.asPlugin(); | 21 RewriteTransformer.asPlugin(); |
| 22 | 22 |
| 23 String get allowedExtensions => '.txt'; | 23 String get allowedExtensions => '.txt'; |
| 24 | 24 |
| 25 Future apply(Transform transform) => throw new Exception('oh no!'); | 25 Future apply(Transform transform) => throw new Exception('oh no!'); |
| 26 } | 26 } |
| 27 """; | 27 """; |
| 28 | 28 |
| 29 main() { | 29 main() { |
| 30 integration("outputs error to JSON in a failed build", () { | 30 integration("outputs error to JSON in a failed build", () { |
| 31 serveBarback(); |
| 32 |
| 31 d.dir(appPath, [ | 33 d.dir(appPath, [ |
| 32 d.pubspec({ | 34 d.pubspec({ |
| 33 "name": "myapp", | 35 "name": "myapp", |
| 34 "transformers": ["myapp"] | 36 "transformers": ["myapp"], |
| 37 "dependencies": {"barback": "any"} |
| 35 }), | 38 }), |
| 36 d.dir("lib", [ | 39 d.dir("lib", [ |
| 37 d.file("transformer.dart", TRANSFORMER) | 40 d.file("transformer.dart", TRANSFORMER) |
| 38 ]), | 41 ]), |
| 39 d.dir("web", [ | 42 d.dir("web", [ |
| 40 d.file("foo.txt", "foo") | 43 d.file("foo.txt", "foo") |
| 41 ]) | 44 ]) |
| 42 ]).create(); | 45 ]).create(); |
| 43 | 46 |
| 44 createLockFile('myapp', pkg: ['barback']); | 47 pubGet(); |
| 45 | |
| 46 schedulePub(args: ["build", "--format", "json"], | 48 schedulePub(args: ["build", "--format", "json"], |
| 47 outputJson: { | 49 outputJson: { |
| 48 "buildResult": "failure", | 50 "buildResult": "failure", |
| 49 "errors": [ | 51 "errors": [ |
| 50 { | 52 { |
| 51 "error": startsWith("Transform Rewrite on myapp|web/foo.txt " | 53 "error": startsWith("Transform Rewrite on myapp|web/foo.txt " |
| 52 "threw error: oh no!") | 54 "threw error: oh no!") |
| 53 } | 55 } |
| 54 ], | 56 ], |
| 55 "log": [] | 57 "log": [] |
| 56 }, | 58 }, |
| 57 exitCode: exit_codes.DATA); | 59 exitCode: exit_codes.DATA); |
| 58 }); | 60 }); |
| 59 } | 61 } |
| OLD | NEW |