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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user