| 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 integration("compiles a Dart file that imports a generated file to JS " | 13 integration("compiles a Dart file that imports a generated file to JS " |
| 14 "outside web/", () { | 14 "outside web/", () { |
| 15 serveBarback(); |
| 16 |
| 15 d.dir(appPath, [ | 17 d.dir(appPath, [ |
| 16 d.pubspec({ | 18 d.pubspec({ |
| 17 "name": "myapp", | 19 "name": "myapp", |
| 18 "version": "0.0.1", | 20 "version": "0.0.1", |
| 19 "transformers": ["myapp/transformer"] | 21 "transformers": ["myapp/transformer"], |
| 22 "dependencies": {"barback": "any"} |
| 20 }), | 23 }), |
| 21 d.dir("lib", [ | 24 d.dir("lib", [ |
| 22 d.file("transformer.dart", dartTransformer("munge")) | 25 d.file("transformer.dart", dartTransformer("munge")) |
| 23 ]), | 26 ]), |
| 24 d.dir("test", [ | 27 d.dir("test", [ |
| 25 d.file("main.dart", """ | 28 d.file("main.dart", """ |
| 26 import "other.dart"; | 29 import "other.dart"; |
| 27 void main() => print(TOKEN); | 30 void main() => print(TOKEN); |
| 28 """), | 31 """), |
| 29 d.file("other.dart", """ | 32 d.file("other.dart", """ |
| 30 library other; | 33 library other; |
| 31 const TOKEN = "before"; | 34 const TOKEN = "before"; |
| 32 """) | 35 """) |
| 33 ]) | 36 ]) |
| 34 ]).create(); | 37 ]).create(); |
| 35 | 38 |
| 36 createLockFile('myapp', pkg: ['barback']); | 39 pubGet(); |
| 37 | |
| 38 pubServe(args: ["test"]); | 40 pubServe(args: ["test"]); |
| 39 requestShouldSucceed("main.dart.js", contains("(before, munge)"), | 41 requestShouldSucceed("main.dart.js", contains("(before, munge)"), |
| 40 root: "test"); | 42 root: "test"); |
| 41 endPubServe(); | 43 endPubServe(); |
| 42 }); | 44 }); |
| 43 } | 45 } |
| OLD | NEW |