mirror of
https://github.com/zoriya/react-native-web.git
synced 2026-05-26 15:58:28 +00:00
[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:
committed by
Nicolas Gallagher
parent
8d1f5afead
commit
74a36a2a4e
+7
@@ -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"
|
||||
}
|
||||
@@ -11,7 +11,7 @@
|
||||
"files": [
|
||||
"dist",
|
||||
"jest",
|
||||
"jest-preset.json",
|
||||
"jest-preset.js",
|
||||
"src",
|
||||
"!**/__tests__"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user