1
+ // ignore_for_file: invalid_use_of_internal_member
2
+
1
3
import 'package:flutter_test/flutter_test.dart' ;
2
4
import 'package:package_info_plus/package_info_plus.dart' ;
3
5
import 'package:sentry_flutter/sentry_flutter.dart' ;
@@ -13,12 +15,15 @@ import 'sentry_flutter_util.dart';
13
15
/// They don't depend on the underlying platform.
14
16
final platformAgnosticIntegrations = [
15
17
WidgetsFlutterBindingIntegration ,
16
- OnErrorIntegration ,
17
18
FlutterErrorIntegration ,
18
19
LoadReleaseIntegration ,
19
20
DebugPrintIntegration ,
20
21
];
21
22
23
+ final nonWebIntegrations = [
24
+ OnErrorIntegration ,
25
+ ];
26
+
22
27
// These should only be added to Android
23
28
final androidIntegrations = [
24
29
LoadImageListIntegration ,
@@ -69,6 +74,7 @@ void main() {
69
74
...androidIntegrations,
70
75
...nativeIntegrations,
71
76
...platformAgnosticIntegrations,
77
+ ...nonWebIntegrations,
72
78
],
73
79
shouldNotHaveIntegrations: iOsAndMacOsIntegrations);
74
80
@@ -109,6 +115,7 @@ void main() {
109
115
...iOsAndMacOsIntegrations,
110
116
...nativeIntegrations,
111
117
...platformAgnosticIntegrations,
118
+ ...nonWebIntegrations,
112
119
],
113
120
shouldNotHaveIntegrations: androidIntegrations,
114
121
);
@@ -147,6 +154,7 @@ void main() {
147
154
...iOsAndMacOsIntegrations,
148
155
...nativeIntegrations,
149
156
...platformAgnosticIntegrations,
157
+ ...nonWebIntegrations,
150
158
],
151
159
shouldNotHaveIntegrations: androidIntegrations,
152
160
);
@@ -181,7 +189,10 @@ void main() {
181
189
182
190
testConfiguration (
183
191
integrations: integrations,
184
- shouldHaveIntegrations: platformAgnosticIntegrations,
192
+ shouldHaveIntegrations: [
193
+ ...platformAgnosticIntegrations,
194
+ ...nonWebIntegrations,
195
+ ],
185
196
shouldNotHaveIntegrations: [
186
197
...androidIntegrations,
187
198
...iOsAndMacOsIntegrations,
@@ -219,7 +230,10 @@ void main() {
219
230
220
231
testConfiguration (
221
232
integrations: integrations,
222
- shouldHaveIntegrations: platformAgnosticIntegrations,
233
+ shouldHaveIntegrations: [
234
+ ...platformAgnosticIntegrations,
235
+ ...nonWebIntegrations,
236
+ ],
223
237
shouldNotHaveIntegrations: [
224
238
...androidIntegrations,
225
239
...iOsAndMacOsIntegrations,
@@ -265,13 +279,14 @@ void main() {
265
279
...androidIntegrations,
266
280
...iOsAndMacOsIntegrations,
267
281
...nativeIntegrations,
282
+ ...nonWebIntegrations,
268
283
],
269
284
);
270
285
271
286
testBefore (
272
- integrations: integrations,
273
- beforeIntegration: WidgetsFlutterBindingIntegration ,
274
- afterIntegration: OnErrorIntegration );
287
+ integrations: Sentry .currentHub.options. integrations,
288
+ beforeIntegration: RunZonedGuardedIntegration ,
289
+ afterIntegration: WidgetsFlutterBindingIntegration );
275
290
276
291
await Sentry .close ();
277
292
});
@@ -308,13 +323,14 @@ void main() {
308
323
...androidIntegrations,
309
324
...iOsAndMacOsIntegrations,
310
325
...nativeIntegrations,
326
+ ...nonWebIntegrations,
311
327
],
312
328
);
313
329
314
330
testBefore (
315
- integrations: integrations,
316
- beforeIntegration: WidgetsFlutterBindingIntegration ,
317
- afterIntegration: OnErrorIntegration );
331
+ integrations: Sentry .currentHub.options. integrations,
332
+ beforeIntegration: RunZonedGuardedIntegration ,
333
+ afterIntegration: WidgetsFlutterBindingIntegration );
318
334
319
335
await Sentry .close ();
320
336
});
@@ -351,13 +367,14 @@ void main() {
351
367
...androidIntegrations,
352
368
...iOsAndMacOsIntegrations,
353
369
...nativeIntegrations,
370
+ ...nonWebIntegrations,
354
371
],
355
372
);
356
373
357
374
testBefore (
358
- integrations: integrations,
359
- beforeIntegration: WidgetsFlutterBindingIntegration ,
360
- afterIntegration: OnErrorIntegration );
375
+ integrations: Sentry .currentHub.options. integrations,
376
+ beforeIntegration: RunZonedGuardedIntegration ,
377
+ afterIntegration: WidgetsFlutterBindingIntegration );
361
378
362
379
await Sentry .close ();
363
380
});
@@ -393,13 +410,14 @@ void main() {
393
410
...androidIntegrations,
394
411
...iOsAndMacOsIntegrations,
395
412
...nativeIntegrations,
413
+ ...nonWebIntegrations,
396
414
],
397
415
);
398
416
399
417
testBefore (
400
- integrations: integrations,
401
- beforeIntegration: WidgetsFlutterBindingIntegration ,
402
- afterIntegration: OnErrorIntegration );
418
+ integrations: Sentry .currentHub.options. integrations,
419
+ beforeIntegration: RunZonedGuardedIntegration ,
420
+ afterIntegration: WidgetsFlutterBindingIntegration );
403
421
404
422
await Sentry .close ();
405
423
});
0 commit comments