OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS d.file | 1 // Copyright (c) 2013, 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 integration("handles imports in the Dart code", () { | 12 integration("handles imports in the Dart code", () { |
13 d.dir("foo", [ | 13 d.dir("foo", [ |
14 d.libPubspec("foo", "0.0.1"), | 14 d.libPubspec("foo", "0.0.1"), |
15 d.dir("lib", [ | 15 d.dir("lib", [ |
16 d.file("foo.dart", """ | 16 d.file("foo.dart", """ |
| 17 foo() => 'footext'; |
17 """) | 18 """) |
18 ]) | 19 ]) |
19 ]).create(); | 20 ]).create(); |
20 | 21 |
21 d.dir(appPath, [ | 22 d.dir(appPath, [ |
22 d.appPubspec({ | 23 d.appPubspec({ |
23 "foo": {"path": "../foo"} | 24 "foo": {"path": "../foo"} |
24 }), | 25 }), |
25 d.dir("lib", [ | 26 d.dir("lib", [ |
26 d.file("lib.dart", """ | 27 d.file("lib.dart", """ |
| 28 lib() => 'libtext'; |
27 """) | 29 """) |
28 ]), | 30 ]), |
29 d.dir("web", [ | 31 d.dir("web", [ |
30 d.file("main.dart", """ | 32 d.file("main.dart", """ |
31 import 'package:foo/foo.dart'; | 33 import 'package:foo/foo.dart'; |
32 import 'package:myapp/lib.dart'; | 34 import 'package:myapp/lib.dart'; |
33 void main() { | 35 void main() { |
34 print(foo()); | 36 print(foo()); |
35 print(lib()); | 37 print(lib()); |
36 } | 38 } |
37 """) | 39 """) |
38 ]) | 40 ]) |
39 ]).create(); | 41 ]).create(); |
40 | 42 |
41 pubGet(); | 43 pubGet(); |
42 pubServe(); | 44 pubServe(); |
43 requestShouldSucceed("main.dart.js", contains("footext")); | 45 requestShouldSucceed("main.dart.js", contains("footext")); |
44 requestShouldSucceed("main.dart.js", contains("libtext")); | 46 requestShouldSucceed("main.dart.js", contains("libtext")); |
45 endPubServe(); | 47 endPubServe(); |
46 }); | 48 }); |
47 } | 49 } |
OLD | NEW |