Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/run.ts
Original file line number Diff line number Diff line change
@@ -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) {
Expand All @@ -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();
Expand All @@ -32,7 +32,7 @@ function buildDebugConfig(
return {
name: 'Debug vitest case',
request: 'launch',
runtimeArgs: buildVitestArgs(text),
runtimeArgs: buildVitestArgs(text, cwd),
cwd,
runtimeExecutable: 'npx',
skipFiles: ['<node_internals>/**'],
Expand Down