From fbe402912938a60efc340ed51e6cc7ef801ca6b0 Mon Sep 17 00:00:00 2001 From: Jordan Emslie Date: Thu, 29 Feb 2024 13:31:07 -0800 Subject: [PATCH] fix: provide file path to avoid seeking skipped files --- src/run.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/run.ts b/src/run.ts index 3b05d43..e771a93 100644 --- a/src/run.ts +++ b/src/run.ts @@ -1,8 +1,8 @@ import * as vscode from 'vscode'; import * as path from 'path'; -function buildVitestArgs(text: string) { - return ['vitest', 'run', '-t', text]; +function buildVitestArgs(text: string, path: string) { + return ['vitest', 'run', '-t', text, path]; } function buildCdArgs(path: string) { @@ -19,7 +19,7 @@ export function runInTerminal(text: string, filename: string) { const cdArgs = buildCdArgs(casePathStr); terminal.sendText(cdArgs.join(' '), true); - const vitestArgs = buildVitestArgs(caseNameStr); + const vitestArgs = buildVitestArgs(caseNameStr, casePathStr); const npxArgs = ['npx', ...vitestArgs]; terminal.sendText(npxArgs.join(' '), true); terminal.show(); @@ -32,7 +32,7 @@ function buildDebugConfig( return { name: 'Debug vitest case', request: 'launch', - runtimeArgs: buildVitestArgs(text), + runtimeArgs: buildVitestArgs(text, cwd), cwd, runtimeExecutable: 'npx', skipFiles: ['/**'],