Last active
November 24, 2020 10:42
-
-
Save vzaidman/423563ca8388403290723b1e525c5745 to your computer and use it in GitHub Desktop.
How to test two versions of React
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module.exports = { | |
'cacheDirectory': '.cache/jest-cache', | |
'modulePaths': ['<rootDir>/src'], | |
'setupFilesAfterEnv': ['<rootDir>/jestSetup.js'], | |
'moduleNameMapper': { | |
'^@welldone-software/why-did-you-render$': '<rootDir>/src/whyDidYouRender.js' | |
} | |
} | |
if(process.env.USE_REACT_16 === 'true'){ | |
module.exports.cacheDirectory = '.cache/jest-cache-react-16' | |
module.exports.moduleNameMapper = { | |
...module.exports.moduleNameMapper, | |
'^react-is((\\/.*)?)$': 'react-is-16$1', | |
'^react-dom((\\/.*)?)$': 'react-dom-16$1', | |
'^react((\\/.*)?)$': 'react-16$1' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment