Skip to content

Commit a0af24d

Browse files
committed
Fix running single tests
1 parent 6d2d1c0 commit a0af24d

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

vscode/src/extension.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -946,7 +946,7 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
946946
debugConfig['testRun'] = testRun;
947947

948948
const workspaceFolder = vscode.workspace.getWorkspaceFolder(docUri);
949-
if (project || testRun) {
949+
if (project) {
950950
debugConfig['projectFile'] = docUri.toString();
951951
debugConfig['project'] = true;
952952
} else {
@@ -993,6 +993,12 @@ export function activate(context: ExtensionContext): VSNetBeansAPI {
993993
context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.debug.single', async (uri, methodName?, launchConfiguration?, nestedClass?) => {
994994
await runDebug(false, false, uri, methodName, nestedClass, launchConfiguration);
995995
}));
996+
context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.run.test.single', async (uri, methodName?, launchConfiguration?, nestedClass?) => {
997+
await runDebug(true, true, uri, methodName, nestedClass, launchConfiguration);
998+
}));
999+
context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.debug.test.single', async (uri, methodName?, launchConfiguration?, nestedClass?) => {
1000+
await runDebug(false, true, uri, methodName, nestedClass, launchConfiguration);
1001+
}));
9961002
context.subscriptions.push(commands.registerCommand(COMMAND_PREFIX + '.project.run', async (node, launchConfiguration?) => {
9971003
return runDebug(true, false, contextUri(node)?.toString() || '', undefined, undefined, launchConfiguration, true);
9981004
}));

vscode/src/testAdapter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ export class NbTestAdapter {
107107
}
108108
if (!cancellation.isCancellationRequested) {
109109
try {
110-
await commands.executeCommand(request.profile?.kind === TestRunProfileKind.Debug ? COMMAND_PREFIX + '.debug.single' : COMMAND_PREFIX + '.run.single', item.uri.toString(), idx < 0 ? undefined : item.id.slice(idx + 1),
110+
await commands.executeCommand(request.profile?.kind === TestRunProfileKind.Debug ? COMMAND_PREFIX + '.debug.test.single' : COMMAND_PREFIX + '.run.test.single', item.uri.toString(), idx < 0 ? undefined : item.id.slice(idx + 1),
111111
undefined /* configuration */, nestedClass);
112112
} catch(err) {
113113
// test state will be handled in the code below

0 commit comments

Comments
 (0)