From be53ce9790c04c786ea797486af152e3f374c251 Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Tue, 5 Mar 2019 20:33:53 +0800 Subject: [PATCH 1/2] support jest debug --- .gitignore | 1 + packages/@vuepress/test-utils/lib/createJestRunner.js | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index e31dfe570c..568b30d490 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ node_modules TODOs.md packages/@vuepress/shared-utils/lib/ types +.vscode 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' }) } From 921447262d1dc8e824a4a5de2a633b75c1cc9e4a Mon Sep 17 00:00:00 2001 From: Shigma <1700011071@pku.edu.cn> Date: Wed, 6 Mar 2019 00:32:30 +0800 Subject: [PATCH 2/2] Update .gitignore --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index 568b30d490..e31dfe570c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,3 @@ node_modules TODOs.md packages/@vuepress/shared-utils/lib/ types -.vscode