OLD | NEW |
| (Empty) |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
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. | |
4 | |
5 import 'dart:convert'; | |
6 | |
7 import 'package:scheduled_test/scheduled_test.dart'; | |
8 | |
9 import '../descriptor.dart' as d; | |
10 import '../test_pub.dart'; | |
11 | |
12 main() { | |
13 initConfig(); | |
14 integration("compiles dart.js and interop.js next to entrypoints when " | |
15 "dartjs is explicitly configured", () { | |
16 // Dart2js can take a long time to compile dart code, so we increase the | |
17 // timeout to cope with that. | |
18 currentSchedule.timeout *= 3; | |
19 | |
20 serve([ | |
21 d.dir('api', [ | |
22 d.dir('packages', [ | |
23 d.file('browser', JSON.encode({ | |
24 'versions': [packageVersionApiMap(packageMap('browser', '1.0.0'))] | |
25 })), | |
26 d.dir('browser', [ | |
27 d.dir('versions', [ | |
28 d.file('1.0.0', JSON.encode( | |
29 packageVersionApiMap( | |
30 packageMap('browser', '1.0.0'), | |
31 full: true))) | |
32 ]) | |
33 ]) | |
34 ]) | |
35 ]), | |
36 d.dir('packages', [ | |
37 d.dir('browser', [ | |
38 d.dir('versions', [ | |
39 d.tar('1.0.0.tar.gz', [ | |
40 d.file('pubspec.yaml', yaml(packageMap("browser", "1.0.0"))), | |
41 d.dir('lib', [ | |
42 d.file('dart.js', 'contents of dart.js'), | |
43 d.file('interop.js', 'contents of interop.js') | |
44 ]) | |
45 ]) | |
46 ]) | |
47 ]) | |
48 ]) | |
49 ]); | |
50 | |
51 d.dir(appPath, [ | |
52 d.pubspec({ | |
53 "name": "myapp", | |
54 "dependencies": { | |
55 "browser": "1.0.0" | |
56 }, | |
57 "transformers": [{ | |
58 "\$dart2js": { | |
59 "minify": true | |
60 } | |
61 }] | |
62 }), | |
63 d.dir('web', [ | |
64 d.file('file.dart', 'void main() => print("hello");'), | |
65 ]) | |
66 ]).create(); | |
67 | |
68 pubGet(); | |
69 | |
70 schedulePub(args: ["build"], | |
71 output: new RegExp(r'Built 3 files to "build".'), | |
72 exitCode: 0); | |
73 | |
74 d.dir(appPath, [ | |
75 d.dir('build', [ | |
76 d.dir('web', [ | |
77 d.matcherFile('file.dart.js', isMinifiedDart2JSOutput), | |
78 d.dir('packages', [ | |
79 d.dir('browser', [ | |
80 d.file('dart.js', 'contents of dart.js'), | |
81 d.file('interop.js', 'contents of interop.js') | |
82 ]) | |
83 ]), | |
84 ]) | |
85 ]) | |
86 ]).validate(); | |
87 }); | |
88 } | |
OLD | NEW |