diff --git a/integration_tests/wasm/test/hello_world_test.dart b/integration_tests/wasm/test/hello_world_test.dart index 74f44bb8f..9ddd5116b 100644 --- a/integration_tests/wasm/test/hello_world_test.dart +++ b/integration_tests/wasm/test/hello_world_test.dart @@ -13,4 +13,12 @@ void main() { test('1 == 1', () { expect(1, equals(1)); }); + + test('asserts are enabled', () { + expect(shouldFail, throwsA(isA())); + }); +} + +void shouldFail() { + assert(1 == 2); } diff --git a/pkgs/test/CHANGELOG.md b/pkgs/test/CHANGELOG.md index f37470514..0bb81cdc3 100644 --- a/pkgs/test/CHANGELOG.md +++ b/pkgs/test/CHANGELOG.md @@ -1,3 +1,7 @@ +## 1.25.7 + +* Enable asserts for `dart2wasm` tests. + ## 1.25.6 * Point API doc links to `package:test` canonical libraries. diff --git a/pkgs/test/pubspec.yaml b/pkgs/test/pubspec.yaml index 6f58fe3b4..9037cf178 100644 --- a/pkgs/test/pubspec.yaml +++ b/pkgs/test/pubspec.yaml @@ -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 @@ -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' diff --git a/pkgs/test_core/CHANGELOG.md b/pkgs/test_core/CHANGELOG.md index 602304e66..cd058d450 100644 --- a/pkgs/test_core/CHANGELOG.md +++ b/pkgs/test_core/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.6.4 + +* Enable asserts for `dart2wasm` tests. + ## 0.6.3 * Update min SDK constraint to 3.2.0. diff --git a/pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart b/pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart index 08a7c0ae3..7290da49d 100644 --- a/pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart +++ b/pkgs/test_core/lib/src/runner/wasm_compiler_pool.dart @@ -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', diff --git a/pkgs/test_core/pubspec.yaml b/pkgs/test_core/pubspec.yaml index afbf24a75..0deb5aca1 100644 --- a/pkgs/test_core/pubspec.yaml +++ b/pkgs/test_core/pubspec.yaml @@ -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