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