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 <help@stably.ai>
This commit is contained in:
Jinjing
2026-07-05 22:38:02 -07:00
co-authored by Orca
parent 4d6debc270
commit 491d4c31c0
@@ -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<unknown>
await expect(promisified('powershell.exe', ['-NoProfile'])).resolves.toBe('done')
expect(seen[2]).toEqual({ windowsHide: true })
})
})