test: add basic unit tests for all navigators

This commit is contained in:
Satyajit Sahoo
2020-06-30 16:14:52 +02:00
parent 2477db47a0
commit 9ba2f84d18
15 changed files with 279 additions and 43 deletions

View File

@@ -1,3 +1,21 @@
/* eslint-env jest */
/* eslint-disable import/no-extraneous-dependencies */
import 'react-native-gesture-handler/jestSetup';
jest.mock('react-native-reanimated', () => {
const Reanimated = require('react-native-reanimated/mock');
// The mock for `call` immediately calls the callback which is incorrect
// So we override it with a no-op
Reanimated.default.call = () => {};
return Reanimated;
});
// Silence the warning: Animated: `useNativeDriver` is not supported because the native animated module is missing
jest.mock('react-native/Libraries/Animated/src/NativeAnimatedHelper');
const error = console.error;
console.error = (...args) =>