-
-
Notifications
You must be signed in to change notification settings - Fork 234
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed LateInitializationError (#526)
Co-authored-by: Hugo Sartori <[email protected]>
- Loading branch information
Showing
5 changed files
with
94 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
@TestOn('vm') | ||
|
||
import 'package:sentry/sentry.dart'; | ||
import 'package:test/test.dart'; | ||
|
||
import 'mocks.dart'; | ||
|
||
// Tests for the following issue | ||
// https://github.com/getsentry/sentry-dart/issues/508 | ||
// There are no asserts, test are succesfull if no exceptions are thrown. | ||
void main() { | ||
tearDown(() async { | ||
await Sentry.close(); | ||
}); | ||
|
||
test('async re-initilization', () async { | ||
await Sentry.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
|
||
await Sentry.close(); | ||
|
||
await Sentry.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
}); | ||
|
||
// This is the failure from | ||
// https://github.com/getsentry/sentry-dart/issues/508 | ||
test('re-initilization', () { | ||
Sentry.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
|
||
Sentry.close(); | ||
|
||
Sentry.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
}); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
@TestOn('vm') | ||
|
||
import 'package:flutter_test/flutter_test.dart'; | ||
import 'package:sentry/sentry.dart'; | ||
import 'package:sentry_flutter/sentry_flutter.dart'; | ||
|
||
import 'mocks.dart'; | ||
|
||
// Tests for the following issue | ||
// https://github.com/getsentry/sentry-dart/issues/508 | ||
// There are no asserts, test are succesfull if no exceptions are thrown. | ||
void main() { | ||
tearDown(() async { | ||
await Sentry.close(); | ||
}); | ||
|
||
test('async re-initilization', () async { | ||
await SentryFlutter.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
|
||
await Sentry.close(); | ||
|
||
await SentryFlutter.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
}); | ||
|
||
// This is the failure from | ||
// https://github.com/getsentry/sentry-dart/issues/508 | ||
test('re-initilization', () { | ||
SentryFlutter.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
|
||
Sentry.close(); | ||
|
||
SentryFlutter.init((options) { | ||
options.dsn = fakeDsn; | ||
}); | ||
}); | ||
} |