[fix] Jest preset module export

Export the preset as a module so that paths can be resolved relative to a Jest
config file.

Close #1290
This commit is contained in:
Paul Armstrong
2019-03-14 11:24:01 -07:00
committed by Nicolas Gallagher
parent 8d1f5afead
commit 74a36a2a4e
3 changed files with 8 additions and 10 deletions
+7
View File
@@ -0,0 +1,7 @@
module.exports = {
moduleNameMapper: {
'^react-native$': require.resolve('./dist/cjs')
},
setupFiles: [require.resolve('./jest/setup.js')],
testEnvironment: require.resolve('jest-environment-jsdom')
};
@@ -1,9 +0,0 @@
{
"moduleNameMapper": {
"^react-native$": "<rootDir>/node_modules/react-native-web/dist/cjs"
},
"setupFiles": [
"<rootDir>/node_modules/react-native-web/jest/setup.js"
],
"testEnvironment": "jsdom"
}
+1 -1
View File
@@ -11,7 +11,7 @@
"files": [
"dist",
"jest",
"jest-preset.json",
"jest-preset.js",
"src",
"!**/__tests__"
],