From ac716cc0251578858a336f361f514c4060e36a34 Mon Sep 17 00:00:00 2001 From: Sergio Moya <1083296+smoya@users.noreply.github.com> Date: Tue, 4 Jun 2024 14:08:51 +0200 Subject: [PATCH] print always list of browsers --- test/browser/browser.spec.ts | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) diff --git a/test/browser/browser.spec.ts b/test/browser/browser.spec.ts index c38c5e155..2b25c5c36 100644 --- a/test/browser/browser.spec.ts +++ b/test/browser/browser.spec.ts @@ -2,7 +2,6 @@ import fs from 'fs'; import http from 'http'; import path from 'path'; import url from 'url'; -import os from 'os'; import * as child_process from 'child_process'; import puppeteer from 'puppeteer'; @@ -13,25 +12,23 @@ describe('Test browser Parser in the node env', function() { beforeAll(async function() { // if MacOS M1/M2, provide your own path to chromium - if (os.platform() === 'darwin' && os.arch() === 'arm64') { - try { - const browsers = child_process - .execSync('ls ~/.cache/puppeteer') - .toString() - .replace('\n', ''); - if (!browsers) { - throw new Error( - 'error listing browsers!' - ); - } - console.log('BROWSERS:', browsers); - } catch (error) { - console.error(error); - console.log( - '\n\nUnable to find browsers\n\n' + try { + const browsers = child_process + .execSync('ls ~/.cache/puppeteer') + .toString() + .replace('\n', ''); + if (!browsers) { + throw new Error( + 'error listing browsers!' ); - throw error; } + console.log('BROWSERS:', browsers); + } catch (error) { + console.error(error); + console.log( + '\n\nUnable to find browsers\n\n' + ); + throw error; } const __dirname = url.fileURLToPath(new URL('.', import.meta.url)); const htmlPath = path.resolve(__dirname, 'sample-page.html');