fix: address cubic 4/5 review issues

- Preserve encoding/callback args in stdout.write wrapper (json-output.ts)
- Restore global console spy in afterEach (server-connection.test.ts)
- Restore console.error spy in afterEach (on-complete-hook.test.ts)
This commit is contained in:
YeonGyu-Kim
2026-02-07 17:39:16 +09:00
parent 4059d02047
commit eafcac1593
3 changed files with 17 additions and 5 deletions
+3 -3
View File
@@ -20,9 +20,9 @@ export function createJsonOutputManager(
const originalWrite = stdout.write.bind(stdout)
function redirectToStderr(): void {
stdout.write = function (chunk: string): boolean {
return stderr.write(chunk)
}
stdout.write = function (...args: Parameters<NodeJS.WriteStream["write"]>): boolean {
return (stderr.write as Function).apply(stderr, args)
} as NodeJS.WriteStream["write"]
}
function restore(): void {