From 491d4c31c031d269737857ab728dfd415e0f2baa Mon Sep 17 00:00:00 2001 From: Jinjing <6427696+AmethystLiang@users.noreply.github.com> Date: Sun, 5 Jul 2026 22:38:02 -0700 Subject: [PATCH] Fix promisify overload typecheck error in windowsHide wrapper test The wrapper's static type (...args: unknown[]) => unknown makes util.promisify resolve to its zero-arg callback overload, so calling the promisified function with args tripped TS2554 under typecheck. Type the promisified result to the variadic custom-symbol impl the wrapper copies at runtime. Co-authored-by: Orca --- src/main/daemon/windows-hidden-console-children.test.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/daemon/windows-hidden-console-children.test.ts b/src/main/daemon/windows-hidden-console-children.test.ts index 7a7e61f7a96..24b69242341 100644 --- a/src/main/daemon/windows-hidden-console-children.test.ts +++ b/src/main/daemon/windows-hidden-console-children.test.ts @@ -62,7 +62,11 @@ describe('wrapChildProcessApi', () => { } }) const wrapped = wrapChildProcessApi(original) - await expect(promisify(wrapped)('powershell.exe', ['-NoProfile'])).resolves.toBe('done') + // The wrapper's static type is `(...args: unknown[]) => unknown`, which + // makes promisify pick its zero-arg callback overload; the custom-symbol + // impl copied at runtime is variadic, so type the result to match. + const promisified = promisify(wrapped) as (...args: unknown[]) => Promise + await expect(promisified('powershell.exe', ['-NoProfile'])).resolves.toBe('done') expect(seen[2]).toEqual({ windowsHide: true }) }) })