Skip to content

Commit 2d0195a

Browse files
committed
fix: fork
1 parent 1aa19f0 commit 2d0195a

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/cli.test.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,13 @@ it('nrm use <registry> local with user config', async () => {
105105
});
106106

107107
it('nrm use without argument', async () => {
108-
const { stdout } = fork(LOCAL_NRM, ['use']);
108+
const { stdout } = fork(LOCAL_NRM, ['use'], { stdio: 'pipe' });
109109

110110
const message = await new Promise((resolve) => {
111111
stdout?.on('data', (data) => {
112112
resolve(stripAnsi(data.toString()).trim());
113113
});
114114
});
115-
116115
expect(
117116
message,
118117
).toBe(`? Please select the registry you want to use (Use arrow keys)
@@ -285,7 +284,7 @@ describe('nrm delete without argument (use keyword to select delete)', () => {
285284
});
286285

287286
it('nrm delete', async () => {
288-
const { stdout } = fork(LOCAL_NRM, ['del']);
287+
const { stdout } = fork(LOCAL_NRM, ['del'], { stdio: 'pipe' });
289288

290289
const message = await new Promise((resolve) => {
291290
stdout?.on('data', (data) => {
@@ -303,7 +302,7 @@ describe('nrm delete without argument (use keyword to select delete)', () => {
303302
});
304303

305304
it('nrm delete (with keyword input)', async () => {
306-
const { stdout, stdin } = fork(LOCAL_NRM, ['del']);
305+
const { stdout, stdin } = fork(LOCAL_NRM, ['del'], { stdio: 'pipe' });
307306
stdin?.write('\u001b[B');
308307

309308
const message = await new Promise((resolve) => {

0 commit comments

Comments
 (0)