| 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 import 'package:scheduled_test/scheduled_test.dart'; | 5 import 'package:scheduled_test/scheduled_test.dart'; |
| 6 | 6 |
| 7 import '../descriptor.dart' as d; | 7 import '../descriptor.dart' as d; |
| 8 import '../test_pub.dart'; | 8 import '../test_pub.dart'; |
| 9 import '../serve/utils.dart'; | 9 import '../serve/utils.dart'; |
| 10 | 10 |
| 11 main() { | 11 main() { |
| 12 // This is a regression test for issue #17198. | 12 // This is a regression test for issue #17198. |
| 13 initConfig(); | 13 initConfig(); |
| 14 withBarbackVersions("any", () { | 14 withBarbackVersions("any", () { |
| 15 integration("compiles a Dart file that imports a generated file to JS " | 15 integration( |
| 16 "outside web/", () { | 16 "compiles a Dart file that imports a generated file to JS " "outside web
/", |
| 17 d.dir(appPath, [ | 17 () { |
| 18 d.pubspec({ | 18 d.dir(appPath, [d.pubspec({ |
| 19 "name": "myapp", | 19 "name": "myapp", |
| 20 "version": "0.0.1", | 20 "version": "0.0.1", |
| 21 "transformers": ["myapp/transformer"] | 21 "transformers": ["myapp/transformer"] |
| 22 }), | 22 }), |
| 23 d.dir("lib", [ | 23 d.dir("lib", [d.file("transformer.dart", dartTransformer("munge"))])
, |
| 24 d.file("transformer.dart", dartTransformer("munge")) | 24 d.dir("test", [d.file("main.dart", """ |
| 25 ]), | |
| 26 d.dir("test", [ | |
| 27 d.file("main.dart", """ | |
| 28 import "other.dart"; | 25 import "other.dart"; |
| 29 void main() => print(TOKEN); | 26 void main() => print(TOKEN); |
| 30 """), | 27 """), d.file("other.dart", """ |
| 31 d.file("other.dart", """ | |
| 32 library other; | 28 library other; |
| 33 const TOKEN = "before"; | 29 const TOKEN = "before"; |
| 34 """) | 30 """)])]).create(); |
| 35 ]) | |
| 36 ]).create(); | |
| 37 | 31 |
| 38 createLockFile('myapp', pkg: ['barback']); | 32 createLockFile('myapp', pkg: ['barback']); |
| 39 | 33 |
| 40 pubServe(args: ["test"]); | 34 pubServe(args: ["test"]); |
| 41 requestShouldSucceed("main.dart.js", contains("(before, munge)"), | 35 requestShouldSucceed( |
| 36 "main.dart.js", |
| 37 contains("(before, munge)"), |
| 42 root: "test"); | 38 root: "test"); |
| 43 endPubServe(); | 39 endPubServe(); |
| 44 }); | 40 }); |
| 45 }); | 41 }); |
| 46 } | 42 } |
| OLD | NEW |