Don't generate absolute paths in Jest config after ejecting

This commit is contained in:
Dan Abramov
2016-09-18 13:10:33 +03:00
parent 58c5483633
commit d279aa038a

View File

@@ -15,7 +15,9 @@ const paths = require('../../config/paths');
module.exports = (resolve, rootDir) => {
const setupFiles = [resolve('config/polyfills.js')];
if (pathExists.sync(paths.testsSetup)) {
setupFiles.push(paths.testsSetup);
// Use this instead of `paths.testsSetup` to avoid putting
// an absolute filename into configuration after ejecting.
setupFiles.push('<rootDir>/src/setupTests.js');
}
const config = {