Skip to content

Commit b792eeb

Browse files
author
Szymon.Poltorak
committed
refactor(testing): add guard check for console info in mock file
1 parent fa74e58 commit b792eeb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

testing/test-setup/src/lib/chrome-path.mock.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,12 @@ beforeEach(async () => {
1515
error.message.includes('No Chrome installations found.')
1616
) {
1717
const chromium = await import('chromium');
18-
console.info(
19-
`${error.message} Using chromium from node_modules instead: ${chromium.path}`,
20-
);
18+
// console.info may be overridden by multi-progress-bars or other libraries
19+
if (typeof console.info === 'function') {
20+
console.info(
21+
`${error.message} Using chromium from node_modules instead: ${chromium.path}`,
22+
);
23+
}
2124
vi.stubEnv('CHROME_PATH', chromium.path);
2225
} else {
2326
throw error;

0 commit comments

Comments
 (0)