Skip to content

Commit 65fb1cc

Browse files
committed
⬆️ Upgrade to Babel 7 and get tests working again
1 parent 7bee29a commit 65fb1cc

File tree

7 files changed

+214
-1100
lines changed

7 files changed

+214
-1100
lines changed

.babelrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"presets": [
3-
"react-native"
3+
"module:metro-react-native-babel-preset"
4+
],
5+
"plugins": [
6+
"@babel/plugin-proposal-class-properties"
47
]
58
}

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
},
1919
"jest": {
2020
"preset": "react-native",
21+
"transform": {
22+
"node_modules/react-native/.+\\.js$": "<rootDir>/node_modules/react-native/jest/preprocessor.js"
23+
},
2124
"setupFiles": [
2225
"./scripts/setup-jest.js"
2326
],
@@ -56,10 +59,11 @@
5659
"prop-types": "^15.5.10"
5760
},
5861
"devDependencies": {
59-
"babel-cli": "6.26.0",
62+
"@babel/cli": "7.6.4",
63+
"@babel/core": "7.6.4",
64+
"@babel/plugin-proposal-class-properties": "7.5.5",
6065
"babel-eslint": "10.0.3",
6166
"babel-jest": "24.9.0",
62-
"babel-preset-react-native": "4.0.1",
6367
"eslint": "6.5.1",
6468
"eslint-config-airbnb": "18.0.1",
6569
"eslint-config-cooperka": "1.0.2",
@@ -69,8 +73,9 @@
6973
"eslint-plugin-react-native": "3.7.0",
7074
"jest": "24.9.0",
7175
"lodash": "4.17.15",
76+
"metro-react-native-babel-preset": "0.56.0",
7277
"react": "16.8.3",
7378
"react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
74-
"react-test-renderer": "16.10.2"
79+
"react-test-renderer": "16.8.3"
7580
}
7681
}

src/ImmutableListView/__tests__/__snapshots__/EmptyListView.test.js.snap

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ exports[`EmptyListView renders with custom renderRow 1`] = `
1212
initialListSize={10}
1313
onContentSizeChange={[Function]}
1414
onEndReachedThreshold={1000}
15-
onKeyboardDidHide={undefined}
16-
onKeyboardDidShow={undefined}
17-
onKeyboardWillHide={undefined}
18-
onKeyboardWillShow={undefined}
1915
onLayout={[Function]}
2016
onScroll={[Function]}
2117
pageSize={1}
@@ -27,11 +23,7 @@ exports[`EmptyListView renders with custom renderRow 1`] = `
2723
stickySectionHeadersEnabled={true}
2824
>
2925
<View>
30-
<Text
31-
accessible={true}
32-
allowFontScaling={true}
33-
ellipsizeMode="tail"
34-
>
26+
<Text>
3527
"Overridden!"
3628
</Text>
3729
</View>
@@ -50,10 +42,6 @@ exports[`EmptyListView renders with custom text 1`] = `
5042
initialListSize={10}
5143
onContentSizeChange={[Function]}
5244
onEndReachedThreshold={1000}
53-
onKeyboardDidHide={undefined}
54-
onKeyboardDidShow={undefined}
55-
onKeyboardWillHide={undefined}
56-
onKeyboardWillShow={undefined}
5745
onLayout={[Function]}
5846
onScroll={[Function]}
5947
pageSize={1}
@@ -66,9 +54,6 @@ exports[`EmptyListView renders with custom text 1`] = `
6654
>
6755
<View>
6856
<Text
69-
accessible={true}
70-
allowFontScaling={true}
71-
ellipsizeMode="tail"
7257
style={
7358
Object {
7459
"padding": 8,
@@ -94,10 +79,6 @@ exports[`EmptyListView renders with default text 1`] = `
9479
initialListSize={10}
9580
onContentSizeChange={[Function]}
9681
onEndReachedThreshold={1000}
97-
onKeyboardDidHide={undefined}
98-
onKeyboardDidShow={undefined}
99-
onKeyboardWillHide={undefined}
100-
onKeyboardWillShow={undefined}
10182
onLayout={[Function]}
10283
onScroll={[Function]}
10384
pageSize={1}
@@ -110,9 +91,6 @@ exports[`EmptyListView renders with default text 1`] = `
11091
>
11192
<View>
11293
<Text
113-
accessible={true}
114-
allowFontScaling={true}
115-
ellipsizeMode="tail"
11694
style={
11795
Object {
11896
"padding": 8,

0 commit comments

Comments
 (0)