Skip to content

Commit c7f254c

Browse files
committed
use mock transport in test
1 parent 9a345d1 commit c7f254c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

dart/test/exception_identifier_test.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ void main() {
126126

127127
group('Integration test', () {
128128
setUp(() {
129-
fixture.options.transport = MockTransport();
129+
fixture.options.transport = fixture.mockTransport;
130130
});
131131

132132
test(
@@ -139,7 +139,7 @@ void main() {
139139

140140
await client.captureException(ObfuscatedException());
141141

142-
final transport = fixture.options.transport as MockTransport;
142+
final transport = fixture.mockTransport;
143143
final capturedEnvelope = transport.envelopes.first;
144144
final capturedEvent = await eventFromEnvelope(capturedEnvelope);
145145

@@ -154,7 +154,7 @@ void main() {
154154

155155
await client.captureException(ObfuscatedException());
156156

157-
final transport = fixture.options.transport as MockTransport;
157+
final transport = fixture.mockTransport;
158158
final capturedEnvelope = transport.envelopes.first;
159159
final capturedEvent = await eventFromEnvelope(capturedEnvelope);
160160

@@ -165,6 +165,7 @@ void main() {
165165
}
166166

167167
class Fixture {
168+
final mockTransport = MockTransport();
168169
SentryOptions options = defaultTestOptions();
169170
}
170171

0 commit comments

Comments
 (0)