Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DO NOT MERGE] force CI to run #1000

Closed
wants to merge 12 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/if-nodejs-pr-testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: "${{ steps.lockversion.outputs.version }}"
architecture: "${{ matrix.arch }}"
- if: steps.lockversion.outputs.version == '18' && matrix.os == 'windows-latest'
#npm cli 10 is buggy because of some cache issue
name: Install npm cli 8
Expand Down
26 changes: 25 additions & 1 deletion test/browser/browser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ 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';

describe('Test browser Parser in the node env', function() {
Expand All @@ -10,6 +12,28 @@ describe('Test browser Parser in the node env', function() {
let page: puppeteer.Page;

beforeAll(async function() {
// if MacOS M1/M2, provide your own path to chromium
if (os.platform() === 'darwin') {
// 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'
);
throw error;
}
}
const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const htmlPath = path.resolve(__dirname, 'sample-page.html');
const parserScript = path.resolve(__dirname, '../../browser/index.js');
Expand Down Expand Up @@ -58,4 +82,4 @@ describe('Test browser Parser in the node env', function() {
const diagnostics = await page.evaluate(element => element && element.textContent, diagnosticsDiv);
expect(Number(diagnostics)).toBeGreaterThanOrEqual(0);
}, 5000);
});
});
Loading