Skip to content

Commit

Permalink
chore(cli): upgrade to lighthouse v12 & puppeteer v23
Browse files Browse the repository at this point in the history
BREAKING CHANGES:
- Removed Deprecated Lighthouse Budgets
- ESM migration with .mts files
  • Loading branch information
ChristopherPHolder authored Aug 26, 2024
2 parents 2c60939 + fe2fa33 commit 356b9ce
Show file tree
Hide file tree
Showing 43 changed files with 510 additions and 10,404 deletions.
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/user-flow-gh-action@v0.3.2
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

0 comments on commit 356b9ce

Please sign in to comment.