Skip to content

Commit

Permalink
test: Remove dispatchCommand useless warning in tests
Browse files Browse the repository at this point in the history
There are useless warnings coming from the update of @testing-library/react-native linked to the Switch component and dispatchCommand. They are removed in React Native 0.72. This is a temporary mock to keep our tests clean.

callstack/react-native-testing-library#1422
  • Loading branch information
zatteo committed Dec 5, 2023
1 parent cae8d27 commit 63bf532
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions __tests__/jestSetupFile.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,3 +108,10 @@ jest.mock(
'react-native-background-geolocation',
() => mockRNBackgroundGeolocation
)

jest.mock('react-native/Libraries/Components/Switch/Switch', () => {
const mockComponent = require('react-native/jest/mockComponent')
return {
default: mockComponent('react-native/Libraries/Components/Switch/Switch')
}
})

0 comments on commit 63bf532

Please sign in to comment.