Skip to content

Commit 9021313

Browse files
committed
chore: move stdout and stderr blocking experiment to tests/setup.ts
1 parent 5ee369c commit 9021313

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

tests/bin/typescript-demo-lib.test.ts

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,6 @@ import path from 'path';
44
import { mockProcessStdout } from 'jest-mock-process';
55
import main from '@/bin/typescript-demo-lib';
66

7-
if (process.stdout.isTTY) {
8-
// @ts-ignore
9-
process.stdout._handle.setBlocking(true);
10-
} else if (os.platform() === 'win32' && !process.stdout.isTTY) {
11-
// @ts-ignore
12-
process.stdout._handle.setBlocking(false);
13-
}
14-
15-
if (process.stderr.isTTY) {
16-
// @ts-ignore
17-
process.stderr._handle.setBlocking(true);
18-
} else if (os.platform() === 'win32' && !process.stderr.isTTY) {
19-
// @ts-ignore
20-
process.stderr._handle.setBlocking(false);
21-
}
22-
237
const uuidRegex = new RegExp(
248
'[a-z0-9]{8}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{4}-[a-z0-9]{12}',
259
);

tests/setup.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// @ts-ignore windows
2+
process.stdout._handle.setBlocking(true);
3+
// @ts-ignore windows
4+
process.stderr._handle.setBlocking(true);

0 commit comments

Comments
 (0)