From 7d04c915a45478885b6b43053cf7d5d52fa0fbd6 Mon Sep 17 00:00:00 2001 From: Joe Haddad Date: Fri, 24 Feb 2017 17:06:54 -0500 Subject: [PATCH] Use posix paths for Jest config during eject (#1635) Resolves #1417 and #1498. --- packages/react-scripts/scripts/eject.js | 2 +- packages/react-scripts/scripts/test.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/react-scripts/scripts/eject.js b/packages/react-scripts/scripts/eject.js index 6e609c4f9f1..701907fa436 100644 --- a/packages/react-scripts/scripts/eject.js +++ b/packages/react-scripts/scripts/eject.js @@ -129,7 +129,7 @@ prompt( // Add Jest config console.log(' Adding ' + cyan('Jest') + ' configuration'); appPackage.jest = createJestConfig( - filePath => path.join('', filePath), + filePath => path.posix.join('', filePath), null, true ); diff --git a/packages/react-scripts/scripts/test.js b/packages/react-scripts/scripts/test.js index 9de5181d739..1a408215d66 100644 --- a/packages/react-scripts/scripts/test.js +++ b/packages/react-scripts/scripts/test.js @@ -32,7 +32,7 @@ const createJestConfig = require('../utils/createJestConfig'); const path = require('path'); const paths = require('../config/paths'); argv.push('--config', JSON.stringify(createJestConfig( - relativePath => path.resolve(__dirname, '..', relativePath), + relativePath => path.posix.resolve(__dirname.replace(/[\\]+/g, path.posix.sep), '..', relativePath), path.resolve(paths.appSrc, '..'), false )));