Skip to content

Commit

Permalink
add check in test for subtest URI
Browse files Browse the repository at this point in the history
  • Loading branch information
eleanorjboyd committed Dec 4, 2024
1 parent 83a53e3 commit b3f9912
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/test/testing/testController/resultResolver.unit.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -344,10 +344,12 @@ suite('Result Resolver tests', () => {
resultResolver.runIdToTestItem.set(subtestName, mockSubtestItem);

let generatedId: string | undefined;
let generatedUri: Uri | undefined;
testControllerMock
.setup((t) => t.createTestItem(typemoq.It.isAny(), typemoq.It.isAny()))
.setup((t) => t.createTestItem(typemoq.It.isAny(), typemoq.It.isAny(), typemoq.It.isAny()))
.callback((id: string) => {
generatedId = id;
generatedUri = workspaceUri;
traceLog('createTestItem function called with id:', id);
})
.returns(() => ({ id: 'id_this', label: 'label_this', uri: workspaceUri } as TestItem));
Expand All @@ -373,6 +375,7 @@ suite('Result Resolver tests', () => {

// verify that the passed function was called for the single test item
assert.ok(generatedId);
assert.strictEqual(generatedUri, workspaceUri);
assert.strictEqual(generatedId, '[subTest with spaces and [brackets]]');
});
test('resolveExecution handles failed tests correctly', async () => {
Expand Down

0 comments on commit b3f9912

Please sign in to comment.