OLD | NEW |
| (Empty) |
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 | |
3 // BSD-style license that can be found in the LICENSE file. | |
4 | |
5 library pub_tests; | |
6 | |
7 import 'package:scheduled_test/scheduled_stream.dart'; | |
8 import 'package:scheduled_test/scheduled_test.dart'; | |
9 | |
10 import '../../descriptor.dart' as d; | |
11 import '../../test_pub.dart'; | |
12 import '../../serve/utils.dart'; | |
13 | |
14 main() { | |
15 initConfig(); | |
16 withBarbackVersions("any", () { | |
17 integration("works on the dart2js transformer", () { | |
18 d.dir(appPath, [ | |
19 d.pubspec({ | |
20 "name": "myapp", | |
21 "transformers": [ | |
22 { | |
23 "\$dart2js": { | |
24 "\$include": ["web/a.dart", "web/b.dart"], | |
25 "\$exclude": "web/a.dart" | |
26 } | |
27 } | |
28 ] | |
29 }), | |
30 d.dir("web", [ | |
31 d.file("a.dart", "void main() => print('hello');"), | |
32 d.file("b.dart", "void main() => print('hello');"), | |
33 d.file("c.dart", "void main() => print('hello');") | |
34 ]) | |
35 ]).create(); | |
36 | |
37 createLockFile('myapp', pkg: ['barback']); | |
38 | |
39 var server = pubServe(); | |
40 // Dart2js should remain lazy. | |
41 server.stdout.expect("Build completed successfully"); | |
42 | |
43 requestShould404("a.dart.js"); | |
44 requestShouldSucceed("b.dart.js", isNot(isEmpty)); | |
45 server.stdout.expect(consumeThrough(emitsLines( | |
46 "[Info from Dart2JS]:\n" | |
47 "Compiling myapp|web/b.dart..."))); | |
48 server.stdout.expect(consumeThrough("Build completed successfully")); | |
49 | |
50 requestShould404("c.dart.js"); | |
51 endPubServe(); | |
52 }); | |
53 }); | |
54 } | |
OLD | NEW |