@@ -70,7 +70,7 @@ name: sample
7070 await expectLater (
7171 process.stdout,
7272 emits ('The `build_runner` version – $version – '
73- 'is not within the allowed constraint – ^0.8.0 .' ));
73+ 'is not within the allowed constraint – ^0.8.2 .' ));
7474 await process.shouldExit (78 );
7575 });
7676 }
@@ -165,30 +165,53 @@ dependencies:
165165 await process.shouldExit (78 );
166166 });
167167
168- test ('should succeed with valid configuration' , () async {
169- var exampleDirectory = p.absolute (p.join (p.current, '..' , 'example' ));
170- var process = await TestProcess .start (pubPath, ['get' ],
171- workingDirectory: exampleDirectory, environment: _getPubEnvironment ());
168+ group ('should succeed with valid configuration' , () {
169+ for (var withDDC in [true , false ]) {
170+ test (withDDC ? 'DDC' : 'dart2js' , () async {
171+ var exampleDirectory = p.absolute (p.join (p.current, '..' , 'example' ));
172+ var process = await TestProcess .start (pubPath, ['get' ],
173+ workingDirectory: exampleDirectory,
174+ environment: _getPubEnvironment ());
172175
173- await process.shouldExit (0 );
176+ await process.shouldExit (0 );
174177
175- await d.file ('.packages' , isNotEmpty).validate (exampleDirectory);
176- await d.file ('pubspec.lock' , isNotEmpty).validate (exampleDirectory);
178+ await d.file ('.packages' , isNotEmpty).validate (exampleDirectory);
179+ await d.file ('pubspec.lock' , isNotEmpty).validate (exampleDirectory);
177180
178- process = await _runWebDev (['build' , '-o' , d.sandbox],
179- workingDirectory: exampleDirectory);
181+ var args = ['build' , '-o' , 'web:${d .sandbox }' ];
182+ if (withDDC) {
183+ args.add ('--no-release' );
184+ }
180185
181- var output = await process. stdoutStream (). join ( ' \n ' );
186+ process = await _runWebDev (args, workingDirectory : exampleDirectory );
182187
183- expect (output, contains (d.sandbox));
184- expect (output, contains ('[INFO] Succeeded' ));
185- await process.shouldExit (0 );
188+ var output = await process.stdoutStream ().join ('\n ' );
189+
190+ expect (output, contains ('[INFO] Succeeded' ));
191+
192+ if (! withDDC && ! output.contains ('with 0 outputs' )) {
193+ // If outputs were generated, then dart2js should have been run
194+ expect (output, contains ('Running dart2js with' ),
195+ reason: 'Should run dart2js during build.' );
196+ }
186197
187- await d.file ('web/main.dart.js' , isNotEmpty).validate ();
188- }, timeout: const Timeout (const Duration (minutes: 5 )));
198+ await process.shouldExit (0 );
199+
200+ await d.file ('main.dart.js' , isNotEmpty).validate ();
201+
202+ for (var ddcFile in ['main.dart.bootstrap.js' , 'main.ddc.js' ]) {
203+ if (withDDC) {
204+ await d.file (ddcFile, isNotEmpty).validate ();
205+ } else {
206+ await d.nothing (ddcFile).validate ();
207+ }
208+ }
209+ }, timeout: const Timeout (const Duration (minutes: 5 )));
210+ }
211+ });
189212}
190213
191- String _pubspecLock ({String version: '0.8.0 ' }) => '''
214+ String _pubspecLock ({String version: '0.8.2 ' }) => '''
192215# Copy-pasted from a valid run
193216packages:
194217 build_runner:
0 commit comments