Skip to content

Commit 36418f2

Browse files
andravinclaude
andcommitted
fix(testing): update getTestCaseNodes stub to match new signature
The getTestCaseNodes function was changed from a single-parameter function returning an array to a 4-parameter function that mutates the collection array in place (with additional visited and excludeSet parameters for exclude support). Updated the test stub accordingly. Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent f4957e6 commit 36418f2

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

src/test/testing/testController/workspaceTestAdapter.unit.test.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -355,12 +355,14 @@ suite('Workspace test adapter', () => {
355355
);
356356
resultResolver.runIdToVSid.set('mockTestItem1', 'mockTestItem1');
357357

358-
sinon.stub(testItemUtilities, 'getTestCaseNodes').callsFake((testNode: TestItem) =>
359-
// Custom implementation logic here based on the provided testNode and collection
360-
361-
// Example implementation: returning a predefined array of TestItem objects
362-
[testNode],
363-
);
358+
sinon
359+
.stub(testItemUtilities, 'getTestCaseNodes')
360+
.callsFake((testNode: TestItem, collection: TestItem[] = []) => {
361+
// Custom implementation logic here based on the provided testNode and collection
362+
// Push the testNode to the collection (matching the real implementation behavior)
363+
collection.push(testNode);
364+
return collection;
365+
});
364366

365367
const mockTestItem1 = createMockTestItem('mockTestItem1');
366368
const mockTestItem2 = createMockTestItem('mockTestItem2');

0 commit comments

Comments
 (0)