Skip to content

Commit 0d141a5

Browse files
committed
add configurable exports test
1 parent 8bd3e5c commit 0d141a5

File tree

4 files changed

+32
-14
lines changed

4 files changed

+32
-14
lines changed

_test/build.dart2js.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ targets:
99
generate_for:
1010
- web/main.dart
1111
- web/sub/main.dart
12-
- test/config_specific_import_test.dart
13-
- test/config_specific_import_test.dart.browser_test.dart
12+
- test/configurable_uri_test.dart
13+
- test/configurable_uri_test.dart.browser_test.dart
1414
- test/hello_world_test.dart
1515
- test/hello_world_test.dart.browser_test.dart
1616
- test/hello_world_deferred_test.dart
@@ -22,5 +22,5 @@ targets:
2222
- test/sub-dir/subdir_test.dart.browser_test.dart
2323
build_vm_compilers|entrypoint:
2424
generate_for:
25-
- test/config_specific_import_test.dart.vm_test.dart
25+
- test/configurable_uri_test.dart.vm_test.dart
2626
- test/help_test.dart.vm_test.dart

_test/build.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ targets:
55
generate_for:
66
- web/main.dart
77
- web/sub/main.dart
8-
- test/config_specific_import_test.dart
9-
- test/config_specific_import_test.dart.browser_test.dart
8+
- test/configurable_uri_test.dart
9+
- test/configurable_uri_test.dart.browser_test.dart
1010
- test/hello_world_test.dart
1111
- test/hello_world_test.dart.browser_test.dart
1212
- test/hello_world_deferred_test.dart
@@ -18,5 +18,5 @@ targets:
1818
- test/sub-dir/subdir_test.dart.browser_test.dart
1919
build_vm_compilers|entrypoint:
2020
generate_for:
21-
- test/config_specific_import_test.dart.vm_test.dart
21+
- test/configurable_uri_test.dart.vm_test.dart
2222
- test/help_test.dart.vm_test.dart

_test/test/common/message_export.dart

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Copyright (c) 2019, 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+
export 'message.dart'
6+
if (dart.library.io) 'message_io.dart'
7+
if (dart.library.html) 'message_html.dart';

_test/test/config_specific_import_test.dart _test/test/configurable_uri_test.dart

+19-8
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,30 @@
44

55
import 'package:test/test.dart';
66

7-
// ignore: uri_does_not_exist
87
import 'common/message.dart'
9-
// ignore: uri_does_not_exist
108
if (dart.library.io) 'common/message_io.dart'
11-
// ignore: uri_does_not_exist
129
if (dart.library.html) 'common/message_html.dart';
1310

11+
import 'common/message_export.dart' as exported;
12+
1413
main() {
15-
test('Message matches expected', () {
16-
if (1.0 is int) {
14+
group('browser', () {
15+
test('imports', () {
1716
expect(message, contains('Javascript'));
18-
} else {
17+
});
18+
19+
test('exports', () {
20+
expect(exported.message, contains('Javascript'));
21+
});
22+
}, testOn: 'browser');
23+
24+
group('vm', () {
25+
test('imports', () {
1926
expect(message, contains('VM'));
20-
}
21-
});
27+
});
28+
29+
test('exports', () {
30+
expect(exported.message, contains('VM'));
31+
});
32+
}, testOn: 'vm');
2233
}

0 commit comments

Comments
 (0)