OLD | NEW |
(Empty) | |
| 1 import 'package:scheduled_test/scheduled_test.dart'; |
| 2 import '../descriptor.dart' as d; |
| 3 import '../test_pub.dart'; |
| 4 import '../serve/utils.dart'; |
| 5 main() { |
| 6 initConfig(); |
| 7 withBarbackVersions("any", () { |
| 8 integration( |
| 9 "compiles a Dart file that imports a generated file in another " |
| 10 "package to JS", |
| 11 () { |
| 12 d.dir("foo", [d.pubspec({ |
| 13 "name": "foo", |
| 14 "version": "0.0.1", |
| 15 "transformers": ["foo/transformer"] |
| 16 }), d.dir("lib", [d.file("foo.dart", """ |
| 17 library foo; |
| 18 const TOKEN = "before"; |
| 19 foo() => TOKEN; |
| 20 """), d.file("transformer.dart", dartTransformer("munge"))])]).create(); |
| 21 d.dir(appPath, [d.appPubspec({ |
| 22 "foo": { |
| 23 "path": "../foo" |
| 24 } |
| 25 }), d.dir("web", [d.file("main.dart", """ |
| 26 import "package:foo/foo.dart"; |
| 27 main() => print(foo()); |
| 28 """)])]).create(); |
| 29 createLockFile("myapp", sandbox: ["foo"], pkg: ["barback"]); |
| 30 pubServe(); |
| 31 requestShouldSucceed("main.dart.js", contains("(before, munge)")); |
| 32 endPubServe(); |
| 33 }); |
| 34 }); |
| 35 } |
OLD | NEW |