Skip to content

Commit 83c597e

Browse files
authored
enable asserts in dart2wasm tests (#2241)
1 parent 6035380 commit 83c597e

File tree

6 files changed

+20
-3
lines changed

6 files changed

+20
-3
lines changed

integration_tests/wasm/test/hello_world_test.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,12 @@ void main() {
1313
test('1 == 1', () {
1414
expect(1, equals(1));
1515
});
16+
17+
test('asserts are enabled', () {
18+
expect(shouldFail, throwsA(isA<AssertionError>()));
19+
});
20+
}
21+
22+
void shouldFail() {
23+
assert(1 == 2);
1624
}

pkgs/test/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.25.7
2+
3+
* Enable asserts for `dart2wasm` tests.
4+
15
## 1.25.6
26

37
* Point API doc links to `package:test` canonical libraries.

pkgs/test/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: test
2-
version: 1.25.6
2+
version: 1.25.7
33
description: >-
44
A full featured library for writing and running Dart tests across platforms.
55
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
@@ -35,7 +35,7 @@ dependencies:
3535

3636
# Use an exact version until the test_api and test_core package are stable.
3737
test_api: 0.7.2
38-
test_core: 0.6.3
38+
test_core: 0.6.4
3939

4040
typed_data: ^1.3.0
4141
web_socket_channel: '>=2.0.0 <4.0.0'

pkgs/test_core/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.6.4
2+
3+
* Enable asserts for `dart2wasm` tests.
4+
15
## 0.6.3
26

37
* Update min SDK constraint to 3.2.0.

pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class WasmCompilerPool extends CompilerPool {
3636
final process = await Process.start(Platform.resolvedExecutable, [
3737
'compile',
3838
'wasm',
39+
'--enable-asserts',
3940
'--packages=${(await packageConfigUri).path}',
4041
for (var experiment in enabledExperiments)
4142
'--enable-experiment=$experiment',

pkgs/test_core/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: test_core
2-
version: 0.6.3
2+
version: 0.6.4
33
description: A basic library for writing tests and running them on the VM.
44
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core
55

0 commit comments

Comments
 (0)