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

chore(cli): migrate to latest lighthouse and puppeteer #282

Merged
merged 12 commits into from
Aug 26, 2024
Merged
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
name: Node ${{ matrix.node }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/quality.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [ 18.x ]
node-version: [ 20.x ]
name: Node ${{ matrix.node }}

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]

steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/user-flow-gh-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
steps:
- uses: actions/checkout@v4
- name: use Node.js ${{ matrix.node-version }}
Expand All @@ -19,4 +19,4 @@ jobs:
- name: run:user-flow-action
uses: push-based/[email protected]
with:
rcPath: packages/user-flow-gh-integration/.user-flowrc.json
rcPath: examples/github-report/.user-flowrc.json
2 changes: 1 addition & 1 deletion .github/workflows/user-flow-md-report-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [18.x]
node-version: [20.x]
name: Node ${{ matrix.node }}

steps:
Expand Down
46 changes: 0 additions & 46 deletions budget.json

This file was deleted.

47 changes: 0 additions & 47 deletions e2e/cli-e2e/tests/__snapshots__/help.e2e.test.ts.snap

This file was deleted.

7 changes: 4 additions & 3 deletions e2e/cli-e2e/tests/collect/format.e2e.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { join } from 'node:path';
import { CliTest, DEFAULT_RC, USER_FLOW_MOCKS } from '../../utils/setup';

const DUMMY_USER_FLOW_NAME = 'Basic Navigation Example';
const MOCK_MD_REPORT_HEADER = '| Gather Mode | Performance | Accessibility | Best Practices | Seo |';

describe('collect format', () => {
['html', 'json', 'md'].forEach((format) => {
Expand Down Expand Up @@ -33,7 +34,7 @@ describe('collect format', () => {

const { code, stdout, stderr } = await cli.run('user-flow', ['collect']);

expect(stdout).toContain(`| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |`)
expect(stdout).toContain(MOCK_MD_REPORT_HEADER)
expect(stdout).toContain(DUMMY_USER_FLOW_NAME);
expect(stderr).toBe('');
expect(code).toBe(0);
Expand All @@ -54,7 +55,7 @@ describe('collect format', () => {
expect(isValidFormatedResult(format, content)).toBeTruthy();
});

expect(stdout).toContain(`| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |`)
expect(stdout).toContain(MOCK_MD_REPORT_HEADER)
expect(stdout).toContain(DUMMY_USER_FLOW_NAME);
expect(stderr).toBe('');
expect(code).toBe(0);
Expand All @@ -66,7 +67,7 @@ function isValidFormatedResult(format: string, result: string) {
const isValidFile = {
'html': (report: string) => report.includes(DUMMY_USER_FLOW_NAME),
'json': (report: string) => !!(JSON.parse(report)?.name || '').includes(DUMMY_USER_FLOW_NAME),
'md': (report: string) => report.includes(`| Gather Mode | Performance | Accessibility | Best Practices | Seo | Pwa |`)
'md': (report: string) => report.includes(MOCK_MD_REPORT_HEADER)
};
// @ts-ignore
return isValidFile[format](result);
Expand Down
1 change: 0 additions & 1 deletion e2e/cli-e2e/utils/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ export const DEFAULT_RC = {
outPath: "./measures",
format: ["html"]
},
assert: {}
};

export const KEYBOARD = {
Expand Down
2 changes: 1 addition & 1 deletion examples/github-report/tools/md-report-rename.mts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ console.log(`Rename results for comment action`);

const path = './examples/github-report/measures';

const reportPath = readdirSync(path)[0];
const reportPath = readdirSync(path).find((p) => p.endsWith('.md'));

if (!reportPath) {
throw new Error('Report file not found');
Expand Down
Loading
Loading