Skip to content

Commit 5550eae

Browse files
committed
enable dev mode in all inint tests
1 parent a184cd9 commit 5550eae

File tree

8 files changed

+111
-55
lines changed

8 files changed

+111
-55
lines changed

dart/test/environment_test.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ void main() {
2727
await Sentry.init(
2828
(options) => options,
2929
options: options,
30+
devMode: true,
3031
);
3132

3233
expect(options.dsn, fakeDsn);
@@ -47,6 +48,7 @@ void main() {
4748
await Sentry.init(
4849
(options) => options,
4950
options: options,
51+
devMode: true,
5052
);
5153

5254
expect(options.dsn, 'foo-bar');

dart/test/event_processor/deduplication_event_processor_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ void main() {
8383
options.transport = transport;
8484
options.enableDeduplication = true;
8585
},
86+
devMode: true,
8687
);
8788

8889
// The test doesn't work if `outerTestMethod` is passed as

dart/test/event_processor/enricher/io_enricher_test.dart

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ void main() {
165165
options.dsn = fakeDsn;
166166
sentryOptions = options;
167167
},
168+
devMode: true,
168169
);
169170
await Sentry.close();
170171

dart/test/initialization_test.dart

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,32 @@ void main() {
1414
});
1515

1616
test('async re-initilization', () async {
17-
await Sentry.init((options) {
18-
options.dsn = fakeDsn;
19-
});
17+
await Sentry.init(
18+
(options) {
19+
options.dsn = fakeDsn;
20+
},
21+
devMode: true,
22+
);
2023

2124
await Sentry.close();
2225

23-
await Sentry.init((options) {
24-
options.dsn = fakeDsn;
25-
});
26+
await Sentry.init(
27+
(options) {
28+
options.dsn = fakeDsn;
29+
},
30+
devMode: true,
31+
);
2632
});
2733

2834
// This is the failure from
2935
// https://github.com/getsentry/sentry-dart/issues/508
3036
test('re-initilization', () async {
31-
await Sentry.init((options) {
32-
options.dsn = fakeDsn;
33-
});
37+
await Sentry.init(
38+
(options) {
39+
options.dsn = fakeDsn;
40+
},
41+
devMode: true,
42+
);
3443

3544
await Sentry.close();
3645

dart/test/sentry_test.dart

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -407,9 +407,13 @@ void main() {
407407
..logger = fixture.mockLogger;
408408

409409
final exception = Exception("Exception in options callback");
410-
await Sentry.init((options) async {
411-
throw exception;
412-
}, options: sentryOptions);
410+
await Sentry.init(
411+
(options) async {
412+
throw exception;
413+
},
414+
options: sentryOptions,
415+
devMode: false,
416+
);
413417

414418
expect(fixture.loggedException, exception);
415419
expect(fixture.loggedLevel, SentryLevel.error);
@@ -430,6 +434,7 @@ void main() {
430434
throw exception;
431435
},
432436
options: sentryOptions,
437+
devMode: false,
433438
);
434439

435440
expect(fixture.loggedException, exception);

e2e_test/bin/e2e_test.dart

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@ void main(List<String> arguments) async {
1818
print('AUTH TOKEN is not set');
1919
exit(1);
2020
}
21-
await Sentry.init((options) {
22-
options.dsn = _exampleDsn;
23-
});
21+
await Sentry.init(
22+
(options) {
23+
options.dsn = _exampleDsn;
24+
// ignore: invalid_use_of_internal_member
25+
},
26+
devMode: true,
27+
);
2428

2529
var id = SentryId.empty();
2630
try {

flutter/test/initialization_test.dart

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,43 @@ void main() {
1414
});
1515

1616
test('async re-initilization', () async {
17-
await SentryFlutter.init((options) {
18-
options.dsn = fakeDsn;
19-
});
17+
await SentryFlutter.init(
18+
(options) {
19+
options.dsn = fakeDsn;
20+
},
21+
devMode: true,
22+
);
2023

2124
await Sentry.close();
2225

23-
await SentryFlutter.init((options) {
24-
options.dsn = fakeDsn;
25-
});
26+
await SentryFlutter.init(
27+
(options) {
28+
options.dsn = fakeDsn;
29+
},
30+
devMode: true,
31+
);
2632

2733
await Sentry.close();
2834
});
2935

3036
// This is the failure from
3137
// https://github.com/getsentry/sentry-dart/issues/508
3238
test('re-initilization', () async {
33-
await SentryFlutter.init((options) {
34-
options.dsn = fakeDsn;
35-
});
39+
await SentryFlutter.init(
40+
(options) {
41+
options.dsn = fakeDsn;
42+
},
43+
devMode: true,
44+
);
3645

3746
await Sentry.close();
3847

39-
await SentryFlutter.init((options) {
40-
options.dsn = fakeDsn;
41-
});
48+
await SentryFlutter.init(
49+
(options) {
50+
options.dsn = fakeDsn;
51+
},
52+
devMode: true,
53+
);
4254

4355
await Sentry.close();
4456
});

flutter/test/sentry_flutter_test.dart

Lines changed: 50 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ void main() {
7070
},
7171
appRunner: appRunner,
7272
platformChecker: getPlatformChecker(platform: MockPlatform.android()),
73+
devMode: true,
7374
);
7475

7576
testTransport(
@@ -117,6 +118,7 @@ void main() {
117118
},
118119
appRunner: appRunner,
119120
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
121+
devMode: true,
120122
);
121123

122124
testTransport(
@@ -162,6 +164,7 @@ void main() {
162164
},
163165
appRunner: appRunner,
164166
platformChecker: getPlatformChecker(platform: MockPlatform.macOs()),
167+
devMode: true,
165168
);
166169

167170
testTransport(
@@ -207,6 +210,7 @@ void main() {
207210
},
208211
appRunner: appRunner,
209212
platformChecker: getPlatformChecker(platform: MockPlatform.windows()),
213+
devMode: true,
210214
);
211215

212216
testTransport(
@@ -255,6 +259,7 @@ void main() {
255259
},
256260
appRunner: appRunner,
257261
platformChecker: getPlatformChecker(platform: MockPlatform.linux()),
262+
devMode: true,
258263
);
259264

260265
testTransport(
@@ -306,6 +311,7 @@ void main() {
306311
isWeb: true,
307312
platform: MockPlatform.linux(),
308313
),
314+
devMode: true,
309315
);
310316

311317
testTransport(
@@ -355,6 +361,7 @@ void main() {
355361
isWeb: true,
356362
platform: MockPlatform.iOs(),
357363
),
364+
devMode: true,
358365
);
359366

360367
testTransport(
@@ -398,6 +405,7 @@ void main() {
398405
isWeb: true,
399406
platform: MockPlatform.macOs(),
400407
),
408+
devMode: true,
401409
);
402410

403411
testTransport(
@@ -440,6 +448,7 @@ void main() {
440448
isWeb: true,
441449
platform: MockPlatform.android(),
442450
),
451+
devMode: true,
443452
);
444453

445454
testTransport(
@@ -475,13 +484,16 @@ void main() {
475484
test('installed with skia renderer', () async {
476485
List<Integration> integrations = [];
477486

478-
await SentryFlutter.init((options) async {
479-
options.dsn = fakeDsn;
480-
integrations = options.integrations;
481-
},
482-
appRunner: appRunner,
483-
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
484-
rendererWrapper: MockRendererWrapper(FlutterRenderer.skia));
487+
await SentryFlutter.init(
488+
(options) async {
489+
options.dsn = fakeDsn;
490+
integrations = options.integrations;
491+
},
492+
appRunner: appRunner,
493+
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
494+
rendererWrapper: MockRendererWrapper(FlutterRenderer.skia),
495+
devMode: true,
496+
);
485497

486498
expect(
487499
integrations
@@ -495,13 +507,16 @@ void main() {
495507
test('installed with canvasKit renderer', () async {
496508
List<Integration> integrations = [];
497509

498-
await SentryFlutter.init((options) async {
499-
options.dsn = fakeDsn;
500-
integrations = options.integrations;
501-
},
502-
appRunner: appRunner,
503-
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
504-
rendererWrapper: MockRendererWrapper(FlutterRenderer.canvasKit));
510+
await SentryFlutter.init(
511+
(options) async {
512+
options.dsn = fakeDsn;
513+
integrations = options.integrations;
514+
},
515+
appRunner: appRunner,
516+
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
517+
rendererWrapper: MockRendererWrapper(FlutterRenderer.canvasKit),
518+
devMode: true,
519+
);
505520

506521
expect(
507522
integrations
@@ -515,13 +530,16 @@ void main() {
515530
test('not installed with html renderer', () async {
516531
List<Integration> integrations = [];
517532

518-
await SentryFlutter.init((options) async {
519-
options.dsn = fakeDsn;
520-
integrations = options.integrations;
521-
},
522-
appRunner: appRunner,
523-
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
524-
rendererWrapper: MockRendererWrapper(FlutterRenderer.html));
533+
await SentryFlutter.init(
534+
(options) async {
535+
options.dsn = fakeDsn;
536+
integrations = options.integrations;
537+
},
538+
appRunner: appRunner,
539+
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
540+
rendererWrapper: MockRendererWrapper(FlutterRenderer.html),
541+
devMode: true,
542+
);
525543

526544
expect(
527545
integrations
@@ -535,13 +553,16 @@ void main() {
535553
test('not installed with unknown renderer', () async {
536554
List<Integration> integrations = [];
537555

538-
await SentryFlutter.init((options) async {
539-
options.dsn = fakeDsn;
540-
integrations = options.integrations;
541-
},
542-
appRunner: appRunner,
543-
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
544-
rendererWrapper: MockRendererWrapper(FlutterRenderer.unknown));
556+
await SentryFlutter.init(
557+
(options) async {
558+
options.dsn = fakeDsn;
559+
integrations = options.integrations;
560+
},
561+
appRunner: appRunner,
562+
platformChecker: getPlatformChecker(platform: MockPlatform.iOs()),
563+
rendererWrapper: MockRendererWrapper(FlutterRenderer.unknown),
564+
devMode: true,
565+
);
545566

546567
expect(
547568
integrations
@@ -576,6 +597,7 @@ void main() {
576597
platform: MockPlatform.android(),
577598
isWeb: true,
578599
),
600+
devMode: true,
579601
);
580602

581603
await Sentry.close();

0 commit comments

Comments
 (0)