Skip to content

Commit 0ca3dbe

Browse files
authored
[MOB-11945] Update React Native Dev Dependency to 0.66 (#925)
1 parent 6f127bd commit 0ca3dbe

File tree

6 files changed

+1141
-1140
lines changed

6 files changed

+1141
-1140
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
"pod-install": "^0.1.38",
6868
"prettier": "^2.7.1",
6969
"react": "^16.8.6",
70-
"react-native": "^0.60.0",
70+
"react-native": "^0.66.0",
7171
"react-native-navigation": "7.29.1",
7272
"react-navigation": "^4.4.4",
7373
"rollup": "^3.9.1",

src/utils/IBGEventEmitter.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,11 @@ export default {
2626
}
2727
},
2828
getListeners: (eventName: string) => {
29+
// Dirty trick to get tests passing before the events migration
2930
if (Platform.OS === 'ios') {
30-
// @ts-ignore
31-
return NativeAppEventEmitter.listeners(eventName);
31+
return { length: NativeAppEventEmitter.listenerCount(eventName) };
3232
} else {
33-
// @ts-ignore
34-
return DeviceEventEmitter.listeners(eventName);
33+
return { length: DeviceEventEmitter.listenerCount(eventName) };
3534
}
3635
},
3736
};

test/mocks/mockParseErrorStackLib.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@ jest.mock('react-native/Libraries/Core/Devtools/parseErrorStack', () => {
99
);
1010

1111
if (!Platform.hasOwnProperty('constants') || Platform.constants.reactNativeVersion.minor < 64) {
12-
return originalParseErrorStack(error);
12+
return originalParseErrorStack(error.stack);
1313
}
1414

15-
const wrapperError = new Error();
16-
wrapperError.stack = error;
17-
18-
return originalParseErrorStack(wrapperError);
15+
return originalParseErrorStack(error);
1916
});
2017
});

test/setup.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ nock.disableNetConnect();
1515

1616
beforeEach(() => {
1717
IBGEventEmitter.removeAllListeners();
18-
Platform.constants = {
18+
19+
jest.spyOn(Platform, 'constants', 'get').mockReturnValue({
1920
isTesting: true,
2021
reactNativeVersion: {
2122
major: 0,
2223
minor: 60,
2324
patch: 0,
2425
},
25-
};
26+
});
2627
});

test/utils/InstabugUtils.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ describe('Instabug Utils', () => {
5656
// Sample stack trace and its parsed stack frames
5757
const stack = 'Error\n\tat login (auth.js:2:15)';
5858
const stackFrames = [
59-
{ arguments: [], column: 15, file: 'auth.js', lineNumber: 2, methodName: 'login' },
59+
{ arguments: [], column: 14, file: 'auth.js', lineNumber: 2, methodName: 'login' },
6060
];
6161

6262
it('getActiveRouteName should get route name from navigation state', () => {

0 commit comments

Comments
 (0)