Skip to content

Commit 2aca318

Browse files
committed
Fix InstabugUtils tests
1 parent 9c35069 commit 2aca318

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

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/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)