Skip to content

Commit 46ce6fa

Browse files
chore(deps): update JavaScript SDK to v7.29.0 (#2736)
Co-authored-by: GitHub <noreply@github.com>
1 parent c35c86b commit 46ce6fa

File tree

4 files changed

+125
-107
lines changed

4 files changed

+125
-107
lines changed

CHANGELOG.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
- Bump Cocoa SDK from v7.31.3 to v7.31.5 ([#2699](https://github.com/getsentry/sentry-react-native/pull/2699), [#2714](https://github.com/getsentry/sentry-react-native/pull/2714))
1313
- [changelog](https://github.com/getsentry/sentry-cocoa/blob/8.0.0/CHANGELOG.md#7315)
1414
- [diff](https://github.com/getsentry/sentry-cocoa/compare/7.31.3...7.31.5)
15-
- Bump JavaScript SDK from v7.26.0 to v7.28.1 ([#2705](https://github.com/getsentry/sentry-react-native/pull/2705), [#2709](https://github.com/getsentry/sentry-react-native/pull/2709), [#2715](https://github.com/getsentry/sentry-react-native/pull/2715))
16-
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7281)
17-
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.26.0...7.28.1)
15+
- Bump JavaScript SDK from v7.26.0 to v7.29.0 ([#2705](https://github.com/getsentry/sentry-react-native/pull/2705), [#2709](https://github.com/getsentry/sentry-react-native/pull/2709), [#2715](https://github.com/getsentry/sentry-react-native/pull/2715), [#2736](https://github.com/getsentry/sentry-react-native/pull/2736))
16+
- [changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md#7290)
17+
- [diff](https://github.com/getsentry/sentry-javascript/compare/7.26.0...7.29.0)
1818
- Bump Android SDK from v6.9.2 to v6.11.0 ([#2704](https://github.com/getsentry/sentry-react-native/pull/2704), [#2724](https://github.com/getsentry/sentry-react-native/pull/2724))
1919
- [changelog](https://github.com/getsentry/sentry-java/blob/main/CHANGELOG.md#6110)
2020
- [diff](https://github.com/getsentry/sentry-java/compare/6.9.2...6.11.0)

package.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@
4242
"react-native": ">=0.56.0"
4343
},
4444
"dependencies": {
45-
"@sentry/browser": "7.28.1",
45+
"@sentry/browser": "7.29.0",
4646
"@sentry/cli": "1.74.4",
47-
"@sentry/core": "7.28.1",
48-
"@sentry/hub": "7.28.1",
49-
"@sentry/integrations": "7.28.1",
50-
"@sentry/react": "7.28.1",
51-
"@sentry/tracing": "7.28.1",
52-
"@sentry/types": "7.28.1",
53-
"@sentry/utils": "7.28.1",
47+
"@sentry/core": "7.29.0",
48+
"@sentry/hub": "7.29.0",
49+
"@sentry/integrations": "7.29.0",
50+
"@sentry/react": "7.29.0",
51+
"@sentry/tracing": "7.29.0",
52+
"@sentry/types": "7.29.0",
53+
"@sentry/utils": "7.29.0",
5454
"@sentry/wizard": "1.4.0"
5555
},
5656
"devDependencies": {
57-
"@sentry-internal/eslint-config-sdk": "7.28.1",
58-
"@sentry-internal/eslint-plugin-sdk": "7.28.1",
57+
"@sentry-internal/eslint-config-sdk": "7.29.0",
58+
"@sentry-internal/eslint-plugin-sdk": "7.29.0",
5959
"@sentry/typescript": "^5.20.1",
6060
"@types/jest": "^26.0.15",
6161
"@types/react": "^18.0.25",

test/client.test.ts

Lines changed: 41 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { rejectedSyncPromise, SentryError } from '@sentry/utils';
33
import * as RN from 'react-native';
44

55
import { ReactNativeClient } from '../src/js/client';
6-
import { ReactNativeClientOptions, ReactNativeOptions } from '../src/js/options';
6+
import { ReactNativeClientOptions } from '../src/js/options';
77
import { NativeTransport } from '../src/js/transports/native';
88
import { SDK_NAME, SDK_PACKAGE_NAME, SDK_VERSION } from '../src/js/version';
99
import { NATIVE } from '../src/js/wrapper';
@@ -66,14 +66,20 @@ jest.mock(
6666
{ virtual: true }
6767
);
6868

69-
const DEFAULT_OPTIONS: ReactNativeOptions = {
69+
const DEFAULT_OPTIONS: ReactNativeClientOptions = {
7070
enableNative: true,
7171
enableNativeCrashHandling: true,
7272
enableNativeNagger: true,
7373
autoInitializeNativeSdk: true,
7474
enableAutoPerformanceTracking: true,
7575
enableOutOfMemoryTracking: true,
76-
patchGlobalPromise: true
76+
patchGlobalPromise: true,
77+
integrations: [],
78+
transport: () => ({
79+
send: jest.fn(),
80+
flush: jest.fn(),
81+
}),
82+
stackParser: jest.fn().mockReturnValue([]),
7783
};
7884

7985
afterEach(() => {
@@ -88,7 +94,7 @@ describe('Tests ReactNativeClient', () => {
8894
...DEFAULT_OPTIONS,
8995
dsn: EXAMPLE_DSN,
9096
transport: () => new NativeTransport()
91-
} as ReactNativeClientOptions);
97+
});
9298

9399
await expect(client.eventFromMessage('test')).resolves.toBeDefined();
94100
// @ts-ignore: Is Mocked
@@ -102,7 +108,7 @@ describe('Tests ReactNativeClient', () => {
102108
...DEFAULT_OPTIONS,
103109
dsn: 'not a dsn',
104110
transport: () => new NativeTransport()
105-
} as ReactNativeClientOptions);
111+
});
106112
} catch (e: any) {
107113
expect(e.message).toBe('Invalid Sentry Dsn: not a dsn');
108114
}
@@ -114,7 +120,7 @@ describe('Tests ReactNativeClient', () => {
114120
...DEFAULT_OPTIONS,
115121
dsn: undefined,
116122
transport: () => new NativeTransport()
117-
} as ReactNativeClientOptions);
123+
});
118124

119125
return expect(backend.eventFromMessage('test')).resolves.toBeDefined();
120126
}).not.toThrow();
@@ -131,7 +137,7 @@ describe('Tests ReactNativeClient', () => {
131137
...DEFAULT_OPTIONS,
132138
dsn: EXAMPLE_DSN,
133139
transport: myCustomTransportFn
134-
} as ReactNativeClientOptions);
140+
});
135141
// eslint-disable-next-line @typescript-eslint/unbound-method
136142
expect(client.getTransport()?.flush).toBe(myFlush);
137143
// eslint-disable-next-line @typescript-eslint/unbound-method
@@ -141,7 +147,7 @@ describe('Tests ReactNativeClient', () => {
141147

142148
describe('onReady', () => {
143149
test('calls onReady callback with true if Native SDK is initialized', (done) => {
144-
new ReactNativeClient({
150+
new ReactNativeClient(mockedOptions({
145151
dsn: EXAMPLE_DSN,
146152
enableNative: true,
147153
onReady: ({ didCallNativeInit }) => {
@@ -150,11 +156,11 @@ describe('Tests ReactNativeClient', () => {
150156
done();
151157
},
152158
transport: () => new NativeTransport()
153-
} as ReactNativeOptions as ReactNativeClientOptions);
159+
}));
154160
});
155161

156162
test('calls onReady callback with false if Native SDK was not initialized', (done) => {
157-
new ReactNativeClient({
163+
new ReactNativeClient(mockedOptions({
158164
dsn: EXAMPLE_DSN,
159165
enableNative: false,
160166
onReady: ({ didCallNativeInit }) => {
@@ -163,7 +169,7 @@ describe('Tests ReactNativeClient', () => {
163169
done();
164170
},
165171
transport: () => new NativeTransport()
166-
} as ReactNativeOptions as ReactNativeClientOptions);
172+
}));
167173
});
168174

169175
test('calls onReady callback with false if Native SDK failed to initialize', (done) => {
@@ -173,7 +179,7 @@ describe('Tests ReactNativeClient', () => {
173179
throw new Error();
174180
});
175181

176-
new ReactNativeClient({
182+
new ReactNativeClient(mockedOptions({
177183
dsn: EXAMPLE_DSN,
178184
enableNative: true,
179185
onReady: ({ didCallNativeInit }) => {
@@ -182,7 +188,7 @@ describe('Tests ReactNativeClient', () => {
182188
done();
183189
},
184190
transport: () => new NativeTransport()
185-
} as ReactNativeOptions as ReactNativeClientOptions);
191+
}));
186192
});
187193
});
188194

@@ -195,7 +201,7 @@ describe('Tests ReactNativeClient', () => {
195201
enableNative: true,
196202
transport: () => new NativeTransport()
197203

198-
} as ReactNativeClientOptions);
204+
});
199205
client.nativeCrash();
200206

201207
expect(RN.NativeModules.RNSentry.crash).toBeCalled();
@@ -212,7 +218,7 @@ describe('Tests ReactNativeClient', () => {
212218
send: mockTransportSend,
213219
flush: jest.fn(),
214220
}),
215-
} as ReactNativeClientOptions);
221+
});
216222

217223
client.captureUserFeedback({
218224
comments: 'Test Comments',
@@ -247,7 +253,7 @@ describe('Tests ReactNativeClient', () => {
247253
send: mockTransportSend,
248254
flush: jest.fn(),
249255
}),
250-
} as ReactNativeClientOptions);
256+
});
251257
});
252258

253259
afterEach(() => {
@@ -291,7 +297,7 @@ describe('Tests ReactNativeClient', () => {
291297
send: mockedSend,
292298
flush: jest.fn().mockResolvedValue(true),
293299
});
294-
const client = new ReactNativeClient(<ReactNativeClientOptions>{
300+
const client = new ReactNativeClient({
295301
...DEFAULT_OPTIONS,
296302
dsn: EXAMPLE_DSN,
297303
transport: mockedTransport,
@@ -317,7 +323,7 @@ describe('Tests ReactNativeClient', () => {
317323
send: mockedSend,
318324
flush: jest.fn().mockResolvedValue(true),
319325
});
320-
const client = new ReactNativeClient(<ReactNativeClientOptions> {
326+
const client = new ReactNativeClient({
321327
...DEFAULT_OPTIONS,
322328
dsn: EXAMPLE_DSN,
323329
transport: mockedTransport,
@@ -352,7 +358,7 @@ describe('Tests ReactNativeClient', () => {
352358
flush: jest.fn(),
353359
}),
354360
sendClientReports: false,
355-
} as ReactNativeClientOptions);
361+
});
356362

357363
mockDroppedEvent(client);
358364

@@ -371,7 +377,7 @@ describe('Tests ReactNativeClient', () => {
371377
flush: jest.fn(),
372378
}),
373379
sendClientReports: true,
374-
} as ReactNativeClientOptions);
380+
});
375381

376382
mockDroppedEvent(client);
377383

@@ -405,7 +411,7 @@ describe('Tests ReactNativeClient', () => {
405411
flush: jest.fn(),
406412
}),
407413
sendClientReports: true,
408-
} as ReactNativeClientOptions);
414+
});
409415

410416
client.captureMessage('message_test_value');
411417

@@ -423,7 +429,7 @@ describe('Tests ReactNativeClient', () => {
423429
flush: jest.fn(),
424430
}),
425431
sendClientReports: true,
426-
} as ReactNativeClientOptions);
432+
});
427433

428434
mockDroppedEvent(client);
429435

@@ -444,7 +450,7 @@ describe('Tests ReactNativeClient', () => {
444450
flush: jest.fn(),
445451
}),
446452
sendClientReports: true,
447-
} as ReactNativeClientOptions);
453+
});
448454

449455
mockDroppedEvent(client);
450456
client.captureMessage('message_test_value_1');
@@ -485,3 +491,15 @@ describe('Tests ReactNativeClient', () => {
485491
}
486492
});
487493
});
494+
495+
function mockedOptions(options: Partial<ReactNativeClientOptions>): ReactNativeClientOptions {
496+
return {
497+
integrations: [],
498+
stackParser: jest.fn().mockReturnValue([]),
499+
transport: () => ({
500+
send: jest.fn(),
501+
flush: jest.fn(),
502+
}),
503+
...options,
504+
};
505+
}

0 commit comments

Comments
 (0)