Skip to content
This repository was archived by the owner on Jul 30, 2020. It is now read-only.

Commit a1f9f85

Browse files
authored
fix(revert): upgrade to latest react-navigation v4 (#94)
This reverts commit 065e5f8.
1 parent 6457915 commit a1f9f85

File tree

3 files changed

+3
-47
lines changed

3 files changed

+3
-47
lines changed

examples/__tests__/react-navigation.js

+1-41
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
import '@testing-library/jest-native/extend-expect';
22
import React from 'react';
33
import { Button, Text, View } from 'react-native';
4-
import { createAppContainer, withNavigation } from 'react-navigation';
5-
import { createStackNavigator } from 'react-navigation-stack';
4+
import { createStackNavigator, createAppContainer, withNavigation } from 'react-navigation';
65

76
import { render, fireEvent } from '../../src';
87

@@ -16,45 +15,6 @@ jest
1615
BaseButton: View,
1716
Directions: {},
1817
};
19-
})
20-
.mock('react-native-reanimated', () => {
21-
const View = require('react-native').View;
22-
23-
const Easing = {
24-
linear: jest.fn(),
25-
ease: jest.fn(),
26-
quad: jest.fn(),
27-
cubic: jest.fn(),
28-
poly: jest.fn(),
29-
sin: jest.fn(),
30-
circle: jest.fn(),
31-
exp: jest.fn(),
32-
elastic: jest.fn(),
33-
back: jest.fn(),
34-
bounce: jest.fn(),
35-
bezier: jest.fn(),
36-
in: jest.fn(),
37-
out: jest.fn(),
38-
inOut: jest.fn(),
39-
};
40-
41-
return {
42-
Easing,
43-
Value: jest.fn(),
44-
event: jest.fn(),
45-
add: jest.fn(),
46-
eq: jest.fn(),
47-
set: jest.fn(),
48-
cond: jest.fn(),
49-
interpolate: jest.fn(),
50-
View: View,
51-
Extrapolate: { CLAMP: jest.fn() },
52-
Transition: {
53-
Together: 'Together',
54-
Out: 'Out',
55-
In: 'In',
56-
},
57-
};
5818
});
5919

6020
const Home = ({ navigation }) => (

jest-preset.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ const jestPreset = require('react-native/jest-preset');
33
module.exports = Object.assign(jestPreset, {
44
transformIgnorePatterns: [
55
...jestPreset.transformIgnorePatterns,
6-
'node_modules/(?!(react-native.*|@?react-navigation.*|@?react-native-community.*)/)',
6+
'node_modules/(?!(react-native.*|@?react-navigation.*)/)',
77
],
88
snapshotSerializers: [require.resolve('./dist/preset/serializer.js')],
99
setupFiles: [...jestPreset.setupFiles, require.resolve('./dist/preset/setup.js')],

package.json

+1-5
Original file line numberDiff line numberDiff line change
@@ -55,19 +55,15 @@
5555
"jest-fetch-mock": "^2.1.1",
5656
"jest-in-case": "^1.0.2",
5757
"metro-react-native-babel-preset": "^0.52.0",
58-
"react-native-safe-area-context": "0.6.1",
59-
"@react-native-community/masked-view": "0.1.5",
6058
"prettier": "^1.16.4",
61-
"react-native-reanimated": "1.4.0",
6259
"pretty-quick": "^1.10.0",
6360
"react": "16.9.0",
6461
"react-hooks-testing-library": "^0.5.0",
6562
"react-intl": "^2.8.0",
6663
"react-intl-native": "^2.1.2",
6764
"react-native": "^0.61.1",
6865
"react-native-gesture-handler": "^1.1.0",
69-
"react-navigation": "4.0.10",
70-
"react-navigation-stack": "2.0.0-alpha.38",
66+
"react-navigation": "^3.5.1",
7167
"react-redux": "^7.0.3",
7268
"react-test-renderer": "16.9.0",
7369
"redux": "^4.0.1",

0 commit comments

Comments
 (0)