@@ -243,20 +243,35 @@ void main() {
243
243
}));
244
244
});
245
245
246
- test ('captureEnvelope' , () async {
247
- final data = Uint8List .fromList ([1 , 2 , 3 ]);
248
-
249
- late Uint8List captured;
250
- when (channel.invokeMethod ('captureEnvelope' , any)).thenAnswer (
251
- (invocation) async =>
252
- {captured = invocation.positionalArguments[1 ][0 ] as Uint8List });
246
+ test (
247
+ 'captureEnvelope' ,
248
+ () {
249
+ when (channel.invokeMethod ('captureEnvelope' , any))
250
+ .thenAnswer ((_) async => {});
251
+
252
+ late Matcher matcher;
253
+ if (mockPlatform.isAndroid) {
254
+ matcher = throwsA (predicate ((e) =>
255
+ e is Error &&
256
+ e.toString ().contains ('Unable to locate the helper library' )));
257
+ } else if (mockPlatform.isIOS || mockPlatform.isMacOS) {
258
+ if (Platform ().isMacOS) {
259
+ matcher = throwsA (predicate ((e) =>
260
+ e is Exception &&
261
+ e.toString ().contains ('Failed to load Objective-C class' )));
262
+ } else {
263
+ matcher = throwsA (predicate ((e) =>
264
+ e is ArgumentError &&
265
+ e.toString ().contains ('Failed to lookup symbol' )));
266
+ }
267
+ }
253
268
254
- await sut.captureEnvelope (data, false );
269
+ final data = Uint8List .fromList ([1 , 2 , 3 ]);
270
+ expect (() => sut.captureEnvelope (data, false ), matcher);
255
271
256
- expect (captured, data);
257
- },
258
- skip:
259
- (Platform ().isAndroid || Platform ().isIOS || Platform ().isMacOS));
272
+ verifyZeroInteractions (channel);
273
+ },
274
+ );
260
275
261
276
test ('loadContexts' , () async {
262
277
when (channel.invokeMethod ('loadContexts' ))
0 commit comments