Skip to content

Commit 71626f5

Browse files
committed
e2e_test: Only run pub get once in the example directory
1 parent 3acb931 commit 71626f5

File tree

1 file changed

+14
-11
lines changed

1 file changed

+14
-11
lines changed

webdev/test/e2e_test.dart

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,28 @@ import 'package:webdev/src/util.dart';
1515
import 'test_utils.dart';
1616

1717
void main() {
18-
group('should succeed with valid configuration', () {
19-
for (var withDDC in [true, false]) {
20-
test(withDDC ? 'DDC' : 'dart2js', () async {
21-
var exampleDirectory = p.absolute(p.join(p.current, '..', 'example'));
22-
var process = await TestProcess.start(pubPath, ['get'],
23-
workingDirectory: exampleDirectory,
24-
environment: _getPubEnvironment());
18+
String exampleDirectory;
19+
setUpAll(() async {
20+
exampleDirectory = p.absolute(p.join(p.current, '..', 'example'));
2521

26-
await process.shouldExit(0);
22+
var process = await TestProcess.start(pubPath, ['get'],
23+
workingDirectory: exampleDirectory, environment: _getPubEnvironment());
2724

28-
await d.file('.packages', isNotEmpty).validate(exampleDirectory);
29-
await d.file('pubspec.lock', isNotEmpty).validate(exampleDirectory);
25+
await process.shouldExit(0);
3026

27+
await d.file('.packages', isNotEmpty).validate(exampleDirectory);
28+
await d.file('pubspec.lock', isNotEmpty).validate(exampleDirectory);
29+
});
30+
31+
group('should build with valid configuration', () {
32+
for (var withDDC in [true, false]) {
33+
test(withDDC ? 'DDC' : 'dart2js', () async {
3134
var args = ['build', '-o', 'web:${d.sandbox}'];
3235
if (withDDC) {
3336
args.add('--no-release');
3437
}
3538

36-
process = await runWebDev(args, workingDirectory: exampleDirectory);
39+
var process = await runWebDev(args, workingDirectory: exampleDirectory);
3740

3841
var expectedItems = <Object>['[INFO] Succeeded'];
3942
if (!withDDC) {

0 commit comments

Comments
 (0)