Skip to content

Commit

Permalink
enable asserts in dart2wasm tests (#2241)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 authored Jun 5, 2024
1 parent 6035380 commit 83c597e
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 3 deletions.
8 changes: 8 additions & 0 deletions integration_tests/wasm/test/hello_world_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,12 @@ void main() {
test('1 == 1', () {
expect(1, equals(1));
});

test('asserts are enabled', () {
expect(shouldFail, throwsA(isA<AssertionError>()));
});
}

void shouldFail() {
assert(1 == 2);
}
4 changes: 4 additions & 0 deletions pkgs/test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.25.7

* Enable asserts for `dart2wasm` tests.

## 1.25.6

* Point API doc links to `package:test` canonical libraries.
Expand Down
4 changes: 2 additions & 2 deletions pkgs/test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test
version: 1.25.6
version: 1.25.7
description: >-
A full featured library for writing and running Dart tests across platforms.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test
Expand Down Expand Up @@ -35,7 +35,7 @@ dependencies:

# Use an exact version until the test_api and test_core package are stable.
test_api: 0.7.2
test_core: 0.6.3
test_core: 0.6.4

typed_data: ^1.3.0
web_socket_channel: '>=2.0.0 <4.0.0'
Expand Down
4 changes: 4 additions & 0 deletions pkgs/test_core/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 0.6.4

* Enable asserts for `dart2wasm` tests.

## 0.6.3

* Update min SDK constraint to 3.2.0.
Expand Down
1 change: 1 addition & 0 deletions pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class WasmCompilerPool extends CompilerPool {
final process = await Process.start(Platform.resolvedExecutable, [
'compile',
'wasm',
'--enable-asserts',
'--packages=${(await packageConfigUri).path}',
for (var experiment in enabledExperiments)
'--enable-experiment=$experiment',
Expand Down
2 changes: 1 addition & 1 deletion pkgs/test_core/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: test_core
version: 0.6.3
version: 0.6.4
description: A basic library for writing tests and running them on the VM.
repository: https://github.com/dart-lang/test/tree/master/pkgs/test_core

Expand Down

0 comments on commit 83c597e

Please sign in to comment.