Skip to content
This repository was archived by the owner on Feb 22, 2023. It is now read-only.

Commit cd78021

Browse files
committed
add unit test
1 parent 72a8556 commit cd78021

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

packages/firebase_crashlytics/test/firebase_crashlytics_test.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,18 @@ void main() {
5151
expect(log[0].arguments['keys'], isEmpty);
5252
});
5353

54+
test('onRuntimeException', () async {
55+
crashlytics.enableInDevMode = true;
56+
crashlytics.log('foo');
57+
await crashlytics.onRuntimeException('foo exception', StackTrace.current);
58+
expect(log[0].method, 'Crashlytics#onError');
59+
expect(log[0].arguments['exception'], 'foo exception');
60+
expect(log[0].arguments['context'], 'onRuntimeException');
61+
expect(log[0].arguments['logs'], isNotEmpty);
62+
expect(log[0].arguments['logs'], contains('foo'));
63+
expect(log[0].arguments['keys'], isEmpty);
64+
});
65+
5466
test('isDebuggable', () async {
5567
expect(await crashlytics.isDebuggable(), true);
5668
expect(

0 commit comments

Comments
 (0)