Skip to content

Commit cd5a939

Browse files
committed
test: type the temporary stdin property at its fixture owner
1 parent 404f202 commit cd5a939

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎src/cli/models-cli.auth-login.integration.test.ts‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,14 +53,15 @@ vi.mock("../plugins/providers.runtime.js", () => ({
5353
}));
5454

5555
function makeStdinInteractive(): () => void {
56-
const stdin = process.stdin;
56+
// Piped stdin has no own isTTY property; the fixture owns only its temporary override.
57+
const stdin: { isTTY?: boolean } = process.stdin;
5758
const descriptor = Object.getOwnPropertyDescriptor(stdin, "isTTY");
5859
Object.defineProperty(stdin, "isTTY", { configurable: true, get: () => true });
5960
return () => {
6061
if (descriptor) {
6162
Object.defineProperty(stdin, "isTTY", descriptor);
6263
} else {
63-
Reflect.deleteProperty(stdin, "isTTY");
64+
delete stdin.isTTY;
6465
}
6566
};
6667
}

0 commit comments

Comments
 (0)