Skip to content

Commit

Permalink
test(notification): unblock unit test failure of rn url polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanZhengYP committed May 11, 2023
1 parent 525befc commit dbacebc
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ jest.mock('react-native', () => ({
removeEventListener: jest.fn(),
},
}));
jest.mock('react-native-url-polyfill', () => {
return {
setupURLPolyfill: jest.fn(),
};
});
jest.mock('@aws-amplify/core');

const mockAddEventListener = AppState.addEventListener as jest.Mock;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ jest.mock('react-native', () => ({
addListener: mockAddListener,
})),
}));
jest.mock('react-native-url-polyfill', () => {
return {
setupURLPolyfill: jest.fn(),
};
});
jest.mock('@aws-amplify/core');
jest.mock('@aws-amplify/rtn-push-notification', () => ({
AmplifyRTNPushNotification: {
Expand Down
3 changes: 3 additions & 0 deletions packages/notifications/jest.native.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ module.exports = {
functions: 95,
},
},
transformIgnorePatterns: [
'node_modules/(?!react-native-url-polyfill|@react-native|react-native)',
],
};

0 comments on commit dbacebc

Please sign in to comment.