diff --git a/packages/@vuepress/test-utils/lib/createJestRunner.js b/packages/@vuepress/test-utils/lib/createJestRunner.js index 0139184cad..be3f8c4375 100644 --- a/packages/@vuepress/test-utils/lib/createJestRunner.js +++ b/packages/@vuepress/test-utils/lib/createJestRunner.js @@ -6,9 +6,10 @@ const usedPorts = [] module.exports = function createJestRunner (jestArgs) { return async function () { const execArgv = getChildProcesExecArgv() - const args = [...execArgv, ...jestArgs, ...rawArgs] + const args = [...execArgv, ...jestArgs] console.log(`running node with args: ${args.join(' ')}`) - await execa('jest', args, { + args.unshift(...rawArgs, require.resolve('jest-cli/bin/jest')) + await execa('node', args, { stdio: 'inherit' }) }