I have an Expo app running with version 30, and I’m trying to upgrade it to 31.
Babel is giving me headaches with snapshot testing, where the snapshot fails because it previously contained a component and now it’s a basic component.
I’d rather not update my snapshots to have them full of generic <Component>
.
I previously had a .babelrc file that looked like that
"presets": ["babel-preset-expo", "react-native-dotenv"],
"env": {
"development": {
"plugins": ["transform-react-jsx-source"]
}
}
}
Now I’ve deleted that file and created a babel.config.js that looks like this
api.cache(true);
return {
presets: ['babel-preset-expo', 'module:react-native-dotenv'],
plugins: [
'@babel/transform-arrow-functions',
'@babel/transform-react-jsx-source'
]
};
};
package.json looks like this:
"name": "mixfitapp",
"version": "1.2.0",
"private": true,
"main": "./node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"eject": "expo eject",
"android": "expo start --android",
"ios": "expo start --ios",
"test": "jest",
"storybook": "storybook start -p 7007",
"test:coverage": "jest --coverage && open coverage/lcov-report/index.html"
},
"jest": {
"preset": "jest-expo",
"setupFiles": [
"./tests/setup.js"
],
"collectCoverageFrom": [
"src/**/*.js"
]
},
"husky": {
"hooks": {
"pre-commit": "npm test",
"pre-push": "npm test"
}
},
"dependencies": {
"@expo/vector-icons": "^6.3.1",
"date-fns": "^1.29.0",
"downshift": "^2.2.3",
"expo": "^31.0.4",
"expo-analytics": "^1.0.7",
"expo-camera": "^1.1.0",
"expo-permissions": "^1.1.0",
"formik": "^1.3.0",
"intl": "^1.2.5",
"lodash": "^4.17.11",
"prop-types": "^15.6.2",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-31.0.1.tar.gz",
"react-native-btr": "^1.0.13",
"react-native-circular-progress": "^1.0.1",
"react-native-credit-card-input": "^0.4.1",
"react-native-datepicker": "^1.7.2",
"react-native-dotenv": "^0.2.0",
"react-native-elements": "^0.19.1",
"react-native-keyboard-aware-scroll-view": "^0.7.2",
"react-native-modal-dropdown": "^0.6.2",
"react-navigation": "^2.18.2",
"react-redux": "^5.0.7",
"redux": "^4.0.0",
"redux-logger": "^3.0.6",
"redux-persist": "^5.10.0",
"redux-saga": "^0.16.0",
"stripe-client": "^1.1.5",
"yup": "^0.26.6"
},
"devDependencies": {
"@babel/core": "^7.1.6",
"@dump247/storybook-state": "^1.5.2",
"@storybook/addon-actions": "^3.4.11",
"@storybook/addon-links": "^3.4.10",
"@storybook/addons": "^3.4.10",
"@storybook/react-native": "^3.4.10",
"babel-core": "^7.0.0-bridge.0",
"babel-eslint": "^7.2.3",
"babel-preset-expo": "5",
"babel-runtime": "^6.26.0",
"enzyme": "^3.6.0",
"enzyme-adapter-react-16": "^1.5.0",
"eslint": "^4.0.0",
"eslint-config-prettier": "^3.0.1",
"eslint-config-react-app": "^2.1.0",
"eslint-plugin-flowtype": "^2.50.0",
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-jsx-a11y": "^5.1.1",
"eslint-plugin-prettier": "^2.6.2",
"eslint-plugin-react": "^7.11.1",
"husky": "^1.0.0-rc.15",
"identity-obj-proxy": "^3.0.0",
"jest-expo": "^31.0.0",
"jest-fetch-mock": "^1.6.6",
"prettier": "^1.14.2",
"react-dom": "^16.3.1",
"react-test-renderer": "16.3.1",
"redux-devtools-extension": "^2.13.5",
"redux-mock-store": "^1.5.3"
}
}
I installed it with yarn, not npm.
What other information would you need to help me?