Skip to content

Commit c6479ff

Browse files
committed
fix tests
1 parent 65129bc commit c6479ff

File tree

7 files changed

+25
-5
lines changed

7 files changed

+25
-5
lines changed

src/e2e/fail-threshold-onsuccess.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ describe('lighthousePlugin with failed threshold run (onSuccess)', () => {
3434

3535
it('should output expected log content', async () => {
3636
const logs = [
37+
'Restoring Lighthouse cache...',
38+
'Lighthouse cache restored',
3739
'Generating Lighthouse report. This may take a minute…',
3840
'Running Lighthouse on /',
3941
'Lighthouse scores for /',
@@ -42,6 +44,8 @@ describe('lighthousePlugin with failed threshold run (onSuccess)', () => {
4244
'- Best Practices: 100',
4345
'- SEO: 91',
4446
'- PWA: 30',
47+
'Persisting Lighthouse cache...',
48+
'Lighthouse cache persisted',
4549
];
4650

4751
await lighthousePlugin().onSuccess({ utils: mockUtils });

src/e2e/not-found-onpostbuild.test.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,15 @@ describe('lighthousePlugin with single not-found run (onPostBuild)', () => {
2525

2626
it('should output expected log content', async () => {
2727
const logs = [
28-
'Persisting Lighthouse cache...',
29-
'Lighthouse cache persisted',
28+
'Restoring Lighthouse cache...',
29+
'Lighthouse cache restored',
3030
'Generating Lighthouse report. This may take a minute…',
3131
'Running Lighthouse on example/this-page-does-not-exist',
3232
'Serving and scanning site from directory example',
3333
'ERRORED_DOCUMENT_REQUEST',
3434
'Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404)',
35+
'Persisting Lighthouse cache...',
36+
'Lighthouse cache persisted',
3537
];
3638

3739
await lighthousePlugin({

src/e2e/not-found-onsuccess.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,14 @@ describe('lighthousePlugin with single not-found run (onSuccess)', () => {
2525

2626
it('should output expected log content', async () => {
2727
const logs = [
28+
'Restoring Lighthouse cache...',
29+
'Lighthouse cache restored',
2830
'Generating Lighthouse report. This may take a minute…',
2931
'Running Lighthouse on /this-page-does-not-exist',
3032
'ERRORED_DOCUMENT_REQUEST',
3133
'Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404)',
34+
'Persisting Lighthouse cache...',
35+
'Lighthouse cache persisted',
3236
];
3337

3438
await lighthousePlugin().onSuccess({ utils: mockUtils });

src/e2e/settings-locale.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ describe('lighthousePlugin with custom locale', () => {
3535

3636
it('should output expected log content', async () => {
3737
const logs = [
38+
'Restoring Lighthouse cache...',
39+
'Lighthouse cache restored',
3840
'Generating Lighthouse report. This may take a minute…',
3941
'Running Lighthouse on / using the “es” locale',
4042
'Lighthouse scores for /',
@@ -43,6 +45,8 @@ describe('lighthousePlugin with custom locale', () => {
4345
'- Prácticas recomendadas: 100',
4446
'- SEO: 91',
4547
'- PWA: 30',
48+
'Persisting Lighthouse cache...',
49+
'Lighthouse cache persisted',
4650
];
4751

4852
await lighthousePlugin().onSuccess({ utils: mockUtils });

src/e2e/success-onpostbuild.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ describe('lighthousePlugin with single report per run (onPostBuild)', () => {
2424

2525
it('should output expected log content', async () => {
2626
const logs = [
27-
'Persisting Lighthouse cache...',
28-
'Lighthouse cache persisted',
27+
'Restoring Lighthouse cache...',
28+
'Lighthouse cache restored',
29+
2930
'Generating Lighthouse report. This may take a minute…',
3031
'Running Lighthouse on example/',
3132
'Serving and scanning site from directory example',
@@ -35,6 +36,8 @@ describe('lighthousePlugin with single report per run (onPostBuild)', () => {
3536
'- Best Practices: 100',
3637
'- SEO: 91',
3738
'- PWA: 30',
39+
'Persisting Lighthouse cache...',
40+
'Lighthouse cache persisted',
3841
];
3942
await lighthousePlugin({
4043
fail_deploy_on_score_thresholds: 'true',

src/e2e/success-onsuccess.test.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ describe('lighthousePlugin with single report per run (onSuccess)', () => {
2424

2525
it('should output expected log content', async () => {
2626
const logs = [
27+
'Restoring Lighthouse cache...',
28+
'Lighthouse cache restored',
2729
'Generating Lighthouse report. This may take a minute…',
2830
'Running Lighthouse on /',
2931
'Lighthouse scores for /',
@@ -32,6 +34,8 @@ describe('lighthousePlugin with single report per run (onSuccess)', () => {
3234
'- Best Practices: 100',
3335
'- SEO: 91',
3436
'- PWA: 30',
37+
'Persisting Lighthouse cache...',
38+
'Lighthouse cache persisted',
3539
];
3640
await lighthousePlugin().onSuccess({ utils: mockUtils });
3741
expect(formatMockLog(console.log.mock.calls)).toEqual(logs);

src/lib/run-event/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ const runEvent = async ({
5353
const data = [];
5454

5555
let i = 0;
56-
console.log('Running Lighthouse audits', auditConfigs);
5756
for (const auditConfig of auditConfigs) {
5857
i++;
5958

0 commit comments

Comments
 (0)