diff --git a/test/mk_map_view_controller_test.dart b/test/mk_map_view_controller_test.dart index d107450..f47cd14 100644 --- a/test/mk_map_view_controller_test.dart +++ b/test/mk_map_view_controller_test.dart @@ -266,6 +266,22 @@ void main() { ).has((e) => e.code, 'code').equals('boom'); }); + test('non-platform error propagates unwrapped', () async { + final exception = Exception('custom host error'); + harness.host.errorToThrow = exception; + + Object? caughtError; + StackTrace? caughtTrace; + try { + await harness.controller.setCamera(sampleCamera); + } on Object catch (e, st) { + caughtError = e; + caughtTrace = st; + } + check(caughtError).identicalTo(exception); + check(caughtTrace.toString()).contains('FakeHostApi._record'); + }); + test('queued calls after a failure still run', () async { harness.host.errorToThrow = PlatformException(code: 'boom'); final failing = harness.controller.setCamera(sampleCamera);