Skip to content
This repository was archived by the owner on Jul 23, 2025. It is now read-only.

Commit 79333ec

Browse files
committed
chore(test): block stderr from expected test going on to TTY
this will help prevent confusions in Github Actions, where the output includes the error (even though it is from a test) but the test itself has run successfully
1 parent 8099ca2 commit 79333ec

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test/main.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ test('🧪 run() should throw an error if run on Windows.', async (t) => {
495495

496496
sandbox.stub(os, 'platform').returns('win32');
497497

498+
const stdHook = hookStd(() => {});
499+
498500
try {
499501
await run('http://localhost.test/dummy-cc-reporter', undefined);
500502
t.fail('should actually throw an error and not succeed');
@@ -504,8 +506,11 @@ test('🧪 run() should throw an error if run on Windows.', async (t) => {
504506
'CC Reporter is not supported on Windows!',
505507
'should return the correct error message.'
506508
);
509+
} finally {
510+
stdHook.unhook();
507511
}
508512

513+
stdHook.unhook();
509514
t.end();
510515
});
511516

0 commit comments

Comments
 (0)