Skip to content

Commit 77ebe35

Browse files
committed
Move to a shared config for expected files
1 parent 71626f5 commit 77ebe35

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

webdev/test/e2e_test.dart

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,16 @@ import 'package:webdev/src/util.dart';
1414

1515
import 'test_utils.dart';
1616

17+
/// Key: name of file in web directory
18+
/// Value: `null` - exists in both modes
19+
/// `true` - DDC only
20+
/// `false` - dart2js only
21+
const _testItems = const <String, bool>{
22+
'main.dart.js': null,
23+
'main.dart.bootstrap.js': true,
24+
'main.ddc.js': true
25+
};
26+
1727
void main() {
1828
String exampleDirectory;
1929
setUpAll(() async {
@@ -47,13 +57,13 @@ void main() {
4757
await checkProcessStdout(process, expectedItems);
4858
await process.shouldExit(0);
4959

50-
await d.file('main.dart.js', isNotEmpty).validate();
60+
for (var entry in _testItems.entries) {
61+
var shouldExist = (entry.value ?? withDDC) == withDDC;
5162

52-
for (var ddcFile in ['main.dart.bootstrap.js', 'main.ddc.js']) {
53-
if (withDDC) {
54-
await d.file(ddcFile, isNotEmpty).validate();
63+
if (shouldExist) {
64+
await d.file(entry.key, isNotEmpty).validate();
5565
} else {
56-
await d.nothing(ddcFile).validate();
66+
await d.nothing(entry.key).validate();
5767
}
5868
}
5969
});

0 commit comments

Comments
 (0)