Skip to content

Commit

Permalink
chore: update api for new run configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
connor4312 committed Jul 14, 2021
1 parent 9d1c791 commit 197021c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/testConverterFactory.ts
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -47,13 +47,14 @@ export class TestConverterFactory implements AdapterTestController, vscode.Dispo
private makeTestController() { private makeTestController() {
const ctrl = vscode.test.createTestController( const ctrl = vscode.test.createTestController(
'ms-vscode.test-adapter-converter', 'ms-vscode.test-adapter-converter',
'Test Adapter Converter',
); );
ctrl.root.label = 'Test Adapter Converter'; ctrl.root.label = 'Test Adapter Converter';


ctrl.runHandler = (request, token) => { const makeRunHandler = (debug: boolean): vscode.TestRunHandler => (request, token) => {
if (request.tests.includes(ctrl.root)) { if (request.tests.includes(ctrl.root)) {
for (const converter of this.converters.values()) { for (const converter of this.converters.values()) {
converter.run(ctrl.createTestRun(request), [converter.root], request.debug, token); converter.run(ctrl.createTestRun(request), [converter.root], debug, token);
} }
return; return;
} }
Expand All @@ -70,9 +71,12 @@ export class TestConverterFactory implements AdapterTestController, vscode.Dispo
} }


for (const [converter, tests] of involved) { for (const [converter, tests] of involved) {
converter.run(ctrl.createTestRun(request), tests, request.debug, token); converter.run(ctrl.createTestRun(request), tests, debug, token);
} }
}; };

ctrl.createRunConfiguration('Run', vscode.TestRunConfigurationGroup.Run, makeRunHandler(false), true);
ctrl.createRunConfiguration('Debug', vscode.TestRunConfigurationGroup.Debug, makeRunHandler(true), true);


return ctrl; return ctrl;
} }
Expand Down

0 comments on commit 197021c

Please sign in to comment.