OLD | NEW |
(Empty) | |
| 1 library pub_tests; |
| 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("loads different configurations from the same isolate", () { |
| 9 d.dir("foo", [d.pubspec({ |
| 10 "name": "foo", |
| 11 "version": "1.0.0", |
| 12 "transformers": [{ |
| 13 "foo/first": { |
| 14 "addition": " in foo" |
| 15 } |
| 16 }, "foo/second"] |
| 17 }), |
| 18 d.dir( |
| 19 "lib", |
| 20 [ |
| 21 d.file("first.dart", dartTransformer('foo/first')), |
| 22 d.file("second.dart", dartTransformer('foo/second'))])]).cre
ate(); |
| 23 d.dir(appPath, [d.pubspec({ |
| 24 "name": "myapp", |
| 25 "transformers": [{ |
| 26 "foo/first": { |
| 27 "addition": " in myapp", |
| 28 "\$include": "web/first.dart" |
| 29 } |
| 30 }, { |
| 31 "foo/second": { |
| 32 "\$include": "web/second.dart" |
| 33 } |
| 34 }], |
| 35 "dependencies": { |
| 36 'foo': { |
| 37 'path': '../foo' |
| 38 } |
| 39 } |
| 40 }), |
| 41 d.dir( |
| 42 "web", |
| 43 [ |
| 44 d.file("first.dart", 'const TOKEN = "myapp/first";'), |
| 45 d.file("second.dart", 'const TOKEN = "myapp/second";')])]).c
reate(); |
| 46 createLockFile('myapp', sandbox: ['foo'], pkg: ['barback']); |
| 47 pubServe(); |
| 48 requestShouldSucceed( |
| 49 "first.dart", |
| 50 'const TOKEN = "(myapp/first, foo/first in myapp)";'); |
| 51 requestShouldSucceed( |
| 52 "second.dart", |
| 53 'const TOKEN = "(myapp/second, (foo/second, foo/first in foo))";'); |
| 54 endPubServe(); |
| 55 }); |
| 56 }); |
| 57 } |
OLD | NEW |