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 library pub_tests; | 5 library pub_tests; |
6 | 6 |
7 import 'package:scheduled_test/scheduled_test.dart'; | 7 import 'package:scheduled_test/scheduled_test.dart'; |
8 | 8 |
9 import '../../lib/src/exit_codes.dart' as exit_codes; | 9 import '../../lib/src/exit_codes.dart' as exit_codes; |
10 import '../descriptor.dart' as d; | 10 import '../descriptor.dart' as d; |
(...skipping 14 matching lines...) Expand all Loading... |
25 """; | 25 """; |
26 | 26 |
27 main() { | 27 main() { |
28 initConfig(); | 28 initConfig(); |
29 withBarbackVersions("any", () { | 29 withBarbackVersions("any", () { |
30 integration("outputs error to JSON in a failed build", () { | 30 integration("outputs error to JSON in a failed build", () { |
31 // Loading transformers takes several seconds, so make sure we don't | 31 // Loading transformers takes several seconds, so make sure we don't |
32 // timeout. | 32 // timeout. |
33 currentSchedule.timeout *= 2; | 33 currentSchedule.timeout *= 2; |
34 | 34 |
35 d.dir(appPath, [ | 35 d.dir(appPath, [d.pubspec({ |
36 d.pubspec({ | |
37 "name": "myapp", | 36 "name": "myapp", |
38 "transformers": ["myapp"] | 37 "transformers": ["myapp"] |
39 }), | 38 }), |
40 d.dir("lib", [ | 39 d.dir("lib", [d.file("transformer.dart", TRANSFORMER)]), |
41 d.file("transformer.dart", TRANSFORMER) | 40 d.dir("web", [d.file("foo.txt", "foo")])]).create(); |
42 ]), | |
43 d.dir("web", [ | |
44 d.file("foo.txt", "foo") | |
45 ]) | |
46 ]).create(); | |
47 | 41 |
48 createLockFile('myapp', pkg: ['barback']); | 42 createLockFile('myapp', pkg: ['barback']); |
49 | 43 |
50 schedulePub(args: ["build", "--format", "json"], | 44 schedulePub(args: ["build", "--format", "json"], outputJson: { |
51 outputJson: { | 45 "buildResult": "failure", |
52 "buildResult": "failure", | 46 "errors": [{ |
53 "errors": [ | 47 "error": startsWith( |
54 { | 48 "Transform Rewrite on myapp|web/foo.txt " "threw error: oh no!") |
55 "error": startsWith("Transform Rewrite on myapp|web/foo.txt " | 49 }], |
56 "threw error: oh no!") | 50 "log": [] |
57 } | 51 }, exitCode: exit_codes.DATA); |
58 ], | |
59 "log": [] | |
60 }, | |
61 exitCode: exit_codes.DATA); | |
62 }); | 52 }); |
63 }); | 53 }); |
64 } | 54 } |
OLD | NEW |