diff --git a/flutter_client/test/player/player_provider_test.dart b/flutter_client/test/player/player_provider_test.dart index be31d391..5ba00e0d 100644 --- a/flutter_client/test/player/player_provider_test.dart +++ b/flutter_client/test/player/player_provider_test.dart @@ -14,7 +14,19 @@ void main() { test('audioHandlerProvider must be overridden — bare read throws', () { final container = ProviderContainer(); addTearDown(container.dispose); - expect(() => container.read(audioHandlerProvider), throwsA(isA())); + // Riverpod 3 wraps the underlying error in a ProviderException. The + // intent of the test is "bare read fails," so accept the wrapper as + // long as the inner error is the UnimplementedError we threw. + expect( + () => container.read(audioHandlerProvider), + throwsA(predicate((e) { + if (e is UnimplementedError) return true; + // ProviderException is private to riverpod; match by name + by + // walking its toString for the inner UnimplementedError text. + return e.runtimeType.toString().contains('ProviderException') && + e.toString().contains('UnimplementedError'); + })), + ); }); test('overridden audioHandlerProvider exposes playbackState stream', () {