Skip to content

Commit ac58e46

Browse files
committed
Update tests for getAllProcesses signature
Adjust Windows process provider unit tests to match the updated getAllProcesses API that accepts a flag parameter and uses an error-first callback. Stubs now use signatures like (_flag, callback) and call callback(null, processList); throwing stubs were updated to accept two arguments. These are test-only updates to align with the new function signature.
1 parent 9a33329 commit ac58e46

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/test/unittest/attachQuickPick/provider.unit.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ suite('Attach to process - process provider', () => {
169169
},
170170
];
171171
getOSTypeStub.returns(platform.OSType.Windows);
172-
getAllProcessesStub.callsFake((callback: Function) => callback(processList));
172+
getAllProcessesStub.callsFake((_flag: any,callback: Function) => callback(null,processList));
173173

174174
const attachItems = await provider._getInternalProcessEntries();
175175
sinon.assert.notCalled(plainExecStub);
@@ -330,7 +330,7 @@ suite('Attach to process - process provider', () => {
330330
},
331331
];
332332

333-
getAllProcessesStub.callsFake((callback: Function) => callback(processList));
333+
getAllProcessesStub.callsFake((_flag: any,callback: Function) => callback(null,processList));
334334

335335
const output = await provider.getAttachItems();
336336

@@ -416,7 +416,7 @@ suite('Attach to process - process provider', () => {
416416
},
417417
];
418418

419-
getAllProcessesStub.callsFake((callback: Function) => callback(processList));
419+
getAllProcessesStub.callsFake((_flag: any,callback: Function) => callback(null,processList));
420420

421421
const output = await provider.getAttachItems();
422422

@@ -430,7 +430,7 @@ suite('Attach to process - process provider', () => {
430430
});
431431

432432
test('Should fall back to wmic when getAllProcesses fails', async () => {
433-
getAllProcessesStub.callsFake((_callback: Function) => {
433+
getAllProcessesStub.callsFake((_flag: any,_callback: Function) => {
434434
throw new Error('windows-process-tree unavailable');
435435
});
436436
const windowsOutput = `CommandLine=\r
@@ -484,7 +484,7 @@ ProcessId=5912\r
484484
});
485485

486486
test('Items returned by getAttachItems via wmic fallback should be sorted alphabetically', async () => {
487-
getAllProcessesStub.callsFake((_callback: Function) => {
487+
getAllProcessesStub.callsFake((_flag: any,_callback: Function) => {
488488
throw new Error('windows-process-tree unavailable');
489489
});
490490
const windowsOutput = `CommandLine=\r
@@ -538,7 +538,7 @@ ProcessId=5728\r
538538
});
539539

540540
test('Python processes should be at the top of the list returned by getAttachItems via wmic fallback', async () => {
541-
getAllProcessesStub.callsFake((_callback: Function) => {
541+
getAllProcessesStub.callsFake((_flag: any,_callback: Function) => {
542542
throw new Error('windows-process-tree unavailable');
543543
});
544544
const windowsOutput = `CommandLine=\r

0 commit comments

Comments
 (0)