diff --git a/detox/local-cli/test.js b/detox/local-cli/test.js index 1975c9a16f..8d02da63ea 100644 --- a/detox/local-cli/test.js +++ b/detox/local-cli/test.js @@ -215,7 +215,7 @@ module.exports.handler = function main(program) { const platformString = platform ? shellQuote(`--testNamePattern=^((?!${getPlatformSpecificString(platform)}).)*$`) : ''; const binPath = path.join('node_modules', '.bin', 'jest'); const color = program.color ? '' : ' --no-color'; - const command = `${binPath} ${testFolder} ${configFile}${color} --maxWorkers=${program.workers} ${platformString} ${collectExtraArgs()}`; + const command = `${binPath} "${testFolder}" ${configFile}${color} --maxWorkers=${program.workers} ${platformString} ${collectExtraArgs()}`; const detoxEnvironmentVariables = { configuration: program.configuration, loglevel: program.loglevel, diff --git a/detox/local-cli/test.test.js b/detox/local-cli/test.test.js index c7df75d832..1c03cff18a 100644 --- a/detox/local-cli/test.test.js +++ b/detox/local-cli/test.test.js @@ -51,9 +51,10 @@ describe('test', () => { } catch (e) { console.log(e); } + expect(mockExec).toHaveBeenCalledWith( expect.stringContaining( - "node_modules/.bin/jest e2e --config=e2e/config.json --no-color --maxWorkers=1 '--testNamePattern=^((?!:ios:).)*$'" + `node_modules/.bin/jest \"e2e\" --config=e2e/config.json --no-color --maxWorkers=1 \'--testNamePattern=^((?!:ios:).)*$\'` ), expect.anything() );