Skip to content

Commit b609ac9

Browse files
authored
Use posix paths for Jest config during eject (#1635)
Resolves #1417 and #1498.
1 parent 5155797 commit b609ac9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-scripts/scripts/eject.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ prompt(
129129
// Add Jest config
130130
console.log(' Adding ' + cyan('Jest') + ' configuration');
131131
appPackage.jest = createJestConfig(
132-
filePath => path.join('<rootDir>', filePath),
132+
filePath => path.posix.join('<rootDir>', filePath),
133133
null,
134134
true
135135
);

packages/react-scripts/scripts/test.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ const createJestConfig = require('../utils/createJestConfig');
3232
const path = require('path');
3333
const paths = require('../config/paths');
3434
argv.push('--config', JSON.stringify(createJestConfig(
35-
relativePath => path.resolve(__dirname, '..', relativePath),
35+
relativePath => path.posix.resolve(__dirname.replace(/[\\]+/g, path.posix.sep), '..', relativePath),
3636
path.resolve(paths.appSrc, '..'),
3737
false
3838
)));

0 commit comments

Comments
 (0)