Skip to content

Commit e4b1144

Browse files
committed
docs: update snippet of mocking RN Native Animated Helper
`NativeAnimatedHelper.js` path has been change since RN 0.76 Closes #1516
1 parent c7b1810 commit e4b1144

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

versioned_docs/version-6.x/testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ jest.mock('react-native-reanimated', () => {
3737
});
3838

3939
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
40+
// For RN >= 0.76
41+
jest.mock('react-native/src/private/animated/NativeAnimatedHelper');
42+
43+
// For RN <0.76
4044
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
4145
```
4246

versioned_docs/version-7.x/testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ setUpTests();
6464
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
6565
import { jest } from '@jest/globals';
6666

67+
// For RN >= 0.76
68+
jest.mock('react-native/src/private/animated/NativeAnimatedHelper');
69+
70+
// For RN <0.76
6771
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
6872
```
6973

versioned_docs/version-8.x/testing.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ setUpTests();
6464
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
6565
import { jest } from '@jest/globals';
6666

67+
// For RN >= 0.76
68+
jest.mock('react-native/src/private/animated/NativeAnimatedHelper');
69+
70+
// For RN <0.76
6771
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
6872
```
6973

0 commit comments

Comments
 (0)