Skip to content

Commit c31fee1

Browse files
committed
try fix test
1 parent facc3ba commit c31fee1

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

flutter/test/sentry_flutter_test.dart

+14-9
Original file line numberDiff line numberDiff line change
@@ -665,31 +665,36 @@ void main() {
665665
test(
666666
'should add DartExceptionTypeIdentifier and FlutterExceptionTypeIdentifier by default',
667667
() async {
668-
await SentryFlutter.init((options) {
669-
options.dsn = fakeDsn;
670-
options.automatedTestMode = true;
671-
});
672-
673-
final options = HubAdapter().options;
668+
SentryOptions? actualOptions = null;
669+
await SentryFlutter.init(
670+
(options) {
671+
options.dsn = fakeDsn;
672+
options.automatedTestMode = true;
673+
actualOptions = options;
674+
},
675+
appRunner: appRunner,
676+
);
674677

675-
expect(options.exceptionTypeIdentifiers.length, 2);
678+
expect(actualOptions!.exceptionTypeIdentifiers.length, 2);
676679
// Flutter identifier should be first as it's more specific
677680
expect(
678-
options.exceptionTypeIdentifiers.first,
681+
actualOptions!.exceptionTypeIdentifiers.first,
679682
isA<CachingExceptionTypeIdentifier>().having(
680683
(c) => c.identifier,
681684
'wrapped identifier',
682685
isA<FlutterExceptionTypeIdentifier>(),
683686
),
684687
);
685688
expect(
686-
options.exceptionTypeIdentifiers[1],
689+
actualOptions!.exceptionTypeIdentifiers[1],
687690
isA<CachingExceptionTypeIdentifier>().having(
688691
(c) => c.identifier,
689692
'wrapped identifier',
690693
isA<DartExceptionTypeIdentifier>(),
691694
),
692695
);
696+
697+
await Sentry.close();
693698
});
694699
}
695700

0 commit comments

Comments
 (0)