1+ // ignore_for_file: invalid_use_of_internal_member
2+
13import 'package:flutter_test/flutter_test.dart' ;
24import 'package:package_info_plus/package_info_plus.dart' ;
35import 'package:sentry_flutter/sentry_flutter.dart' ;
@@ -13,12 +15,15 @@ import 'sentry_flutter_util.dart';
1315/// They don't depend on the underlying platform.
1416final platformAgnosticIntegrations = [
1517 WidgetsFlutterBindingIntegration ,
16- OnErrorIntegration ,
1718 FlutterErrorIntegration ,
1819 LoadReleaseIntegration ,
1920 DebugPrintIntegration ,
2021];
2122
23+ final nonWebIntegrations = [
24+ OnErrorIntegration ,
25+ ];
26+
2227// These should only be added to Android
2328final androidIntegrations = [
2429 LoadImageListIntegration ,
@@ -69,6 +74,7 @@ void main() {
6974 ...androidIntegrations,
7075 ...nativeIntegrations,
7176 ...platformAgnosticIntegrations,
77+ ...nonWebIntegrations,
7278 ],
7379 shouldNotHaveIntegrations: iOsAndMacOsIntegrations);
7480
@@ -109,6 +115,7 @@ void main() {
109115 ...iOsAndMacOsIntegrations,
110116 ...nativeIntegrations,
111117 ...platformAgnosticIntegrations,
118+ ...nonWebIntegrations,
112119 ],
113120 shouldNotHaveIntegrations: androidIntegrations,
114121 );
@@ -147,6 +154,7 @@ void main() {
147154 ...iOsAndMacOsIntegrations,
148155 ...nativeIntegrations,
149156 ...platformAgnosticIntegrations,
157+ ...nonWebIntegrations,
150158 ],
151159 shouldNotHaveIntegrations: androidIntegrations,
152160 );
@@ -181,7 +189,10 @@ void main() {
181189
182190 testConfiguration (
183191 integrations: integrations,
184- shouldHaveIntegrations: platformAgnosticIntegrations,
192+ shouldHaveIntegrations: [
193+ ...platformAgnosticIntegrations,
194+ ...nonWebIntegrations,
195+ ],
185196 shouldNotHaveIntegrations: [
186197 ...androidIntegrations,
187198 ...iOsAndMacOsIntegrations,
@@ -219,7 +230,10 @@ void main() {
219230
220231 testConfiguration (
221232 integrations: integrations,
222- shouldHaveIntegrations: platformAgnosticIntegrations,
233+ shouldHaveIntegrations: [
234+ ...platformAgnosticIntegrations,
235+ ...nonWebIntegrations,
236+ ],
223237 shouldNotHaveIntegrations: [
224238 ...androidIntegrations,
225239 ...iOsAndMacOsIntegrations,
@@ -265,13 +279,14 @@ void main() {
265279 ...androidIntegrations,
266280 ...iOsAndMacOsIntegrations,
267281 ...nativeIntegrations,
282+ ...nonWebIntegrations,
268283 ],
269284 );
270285
271286 testBefore (
272- integrations: integrations,
273- beforeIntegration: WidgetsFlutterBindingIntegration ,
274- afterIntegration: OnErrorIntegration );
287+ integrations: Sentry .currentHub.options. integrations,
288+ beforeIntegration: RunZonedGuardedIntegration ,
289+ afterIntegration: WidgetsFlutterBindingIntegration );
275290
276291 await Sentry .close ();
277292 });
@@ -308,13 +323,14 @@ void main() {
308323 ...androidIntegrations,
309324 ...iOsAndMacOsIntegrations,
310325 ...nativeIntegrations,
326+ ...nonWebIntegrations,
311327 ],
312328 );
313329
314330 testBefore (
315- integrations: integrations,
316- beforeIntegration: WidgetsFlutterBindingIntegration ,
317- afterIntegration: OnErrorIntegration );
331+ integrations: Sentry .currentHub.options. integrations,
332+ beforeIntegration: RunZonedGuardedIntegration ,
333+ afterIntegration: WidgetsFlutterBindingIntegration );
318334
319335 await Sentry .close ();
320336 });
@@ -351,13 +367,14 @@ void main() {
351367 ...androidIntegrations,
352368 ...iOsAndMacOsIntegrations,
353369 ...nativeIntegrations,
370+ ...nonWebIntegrations,
354371 ],
355372 );
356373
357374 testBefore (
358- integrations: integrations,
359- beforeIntegration: WidgetsFlutterBindingIntegration ,
360- afterIntegration: OnErrorIntegration );
375+ integrations: Sentry .currentHub.options. integrations,
376+ beforeIntegration: RunZonedGuardedIntegration ,
377+ afterIntegration: WidgetsFlutterBindingIntegration );
361378
362379 await Sentry .close ();
363380 });
@@ -393,13 +410,14 @@ void main() {
393410 ...androidIntegrations,
394411 ...iOsAndMacOsIntegrations,
395412 ...nativeIntegrations,
413+ ...nonWebIntegrations,
396414 ],
397415 );
398416
399417 testBefore (
400- integrations: integrations,
401- beforeIntegration: WidgetsFlutterBindingIntegration ,
402- afterIntegration: OnErrorIntegration );
418+ integrations: Sentry .currentHub.options. integrations,
419+ beforeIntegration: RunZonedGuardedIntegration ,
420+ afterIntegration: WidgetsFlutterBindingIntegration );
403421
404422 await Sentry .close ();
405423 });
0 commit comments