Skip to content

Commit 7c1ed2d

Browse files
committed
Artifact assertions
1 parent ef3beef commit 7c1ed2d

File tree

18 files changed

+1262
-1154
lines changed

18 files changed

+1262
-1154
lines changed

lighthouse-cli/test/smokehouse/a11y/expectations.js

Lines changed: 208 additions & 206 deletions
Large diffs are not rendered by default.

lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js

Lines changed: 112 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -10,134 +10,138 @@
1010
*/
1111
module.exports = [
1212
{
13-
requestedUrl: 'http://localhost:10200/byte-efficiency/tester.html',
14-
finalUrl: 'http://localhost:10200/byte-efficiency/tester.html',
15-
audits: {
16-
'unminified-css': {
17-
details: {
18-
overallSavingsBytes: '>17000',
19-
items: {
20-
length: 2,
13+
lhr: {
14+
requestedUrl: 'http://localhost:10200/byte-efficiency/tester.html',
15+
finalUrl: 'http://localhost:10200/byte-efficiency/tester.html',
16+
audits: {
17+
'unminified-css': {
18+
details: {
19+
overallSavingsBytes: '>17000',
20+
items: {
21+
length: 2,
22+
},
2123
},
2224
},
23-
},
24-
'unminified-javascript': {
25-
score: '<1',
26-
details: {
27-
overallSavingsBytes: '>45000',
28-
overallSavingsMs: '>500',
29-
items: [
30-
{
31-
url: 'http://localhost:10200/byte-efficiency/script.js',
32-
wastedBytes: '46481 +/- 100',
33-
wastedPercent: '87 +/- 5',
34-
},
35-
{
36-
url: 'inline: \n function unusedFunction() {\n // Un...',
37-
wastedBytes: '6581 +/- 100',
38-
wastedPercent: '99.6 +/- 0.1',
39-
},
40-
{
41-
url: 'inline: \n // Used block #1\n // FILLER DATA JUS...',
42-
wastedBytes: '6559 +/- 100',
43-
wastedPercent: 100,
25+
'unminified-javascript': {
26+
score: '<1',
27+
details: {
28+
overallSavingsBytes: '>45000',
29+
overallSavingsMs: '>500',
30+
items: [
31+
{
32+
url: 'http://localhost:10200/byte-efficiency/script.js',
33+
wastedBytes: '46481 +/- 100',
34+
wastedPercent: '87 +/- 5',
35+
},
36+
{
37+
url: 'inline: \n function unusedFunction() {\n // Un...',
38+
wastedBytes: '6581 +/- 100',
39+
wastedPercent: '99.6 +/- 0.1',
40+
},
41+
{
42+
url: 'inline: \n // Used block #1\n // FILLER DATA JUS...',
43+
wastedBytes: '6559 +/- 100',
44+
wastedPercent: 100,
45+
},
46+
],
47+
},
48+
},
49+
'unused-css-rules': {
50+
details: {
51+
overallSavingsBytes: '>35000',
52+
items: {
53+
length: 2,
4454
},
45-
],
55+
},
4656
},
47-
},
48-
'unused-css-rules': {
49-
details: {
50-
overallSavingsBytes: '>35000',
51-
items: {
52-
length: 2,
57+
'unused-javascript': {
58+
score: '<1',
59+
details: {
60+
overallSavingsBytes: '>=25000',
61+
overallSavingsMs: '>300',
62+
items: {
63+
length: 2,
64+
},
5365
},
5466
},
55-
},
56-
'unused-javascript': {
57-
score: '<1',
58-
details: {
59-
overallSavingsBytes: '>=25000',
60-
overallSavingsMs: '>300',
61-
items: {
62-
length: 2,
67+
'offscreen-images': {
68+
details: {
69+
items: [
70+
{
71+
url: /lighthouse-unoptimized.jpg$/,
72+
}, {
73+
url: /lighthouse-480x320.webp$/,
74+
}, {
75+
url: /lighthouse-480x320.webp\?invisible$/,
76+
}, {
77+
url: /large.svg$/,
78+
},
79+
],
6380
},
6481
},
65-
},
66-
'offscreen-images': {
67-
details: {
68-
items: [
69-
{
70-
url: /lighthouse-unoptimized.jpg$/,
71-
}, {
72-
url: /lighthouse-480x320.webp$/,
73-
}, {
74-
url: /lighthouse-480x320.webp\?invisible$/,
75-
}, {
76-
url: /large.svg$/,
82+
'uses-webp-images': {
83+
details: {
84+
overallSavingsBytes: '>60000',
85+
items: {
86+
length: 4,
7787
},
78-
],
79-
},
80-
},
81-
'uses-webp-images': {
82-
details: {
83-
overallSavingsBytes: '>60000',
84-
items: {
85-
length: 4,
8688
},
8789
},
88-
},
89-
'uses-text-compression': {
90-
score: '<1',
91-
details: {
92-
overallSavingsMs: '>700',
93-
overallSavingsBytes: '>50000',
94-
items: {
95-
length: 2,
90+
'uses-text-compression': {
91+
score: '<1',
92+
details: {
93+
overallSavingsMs: '>700',
94+
overallSavingsBytes: '>50000',
95+
items: {
96+
length: 2,
97+
},
9698
},
9799
},
98-
},
99-
'uses-optimized-images': {
100-
details: {
101-
overallSavingsBytes: '>10000',
102-
items: {
103-
length: 1,
100+
'uses-optimized-images': {
101+
details: {
102+
overallSavingsBytes: '>10000',
103+
items: {
104+
length: 1,
105+
},
104106
},
105107
},
106-
},
107-
'uses-responsive-images': {
108-
displayValue: 'Potential savings of 75\xa0KB',
109-
details: {
110-
overallSavingsBytes: '>75000',
111-
items: [
112-
{wastedPercent: '<60'},
113-
{wastedPercent: '<60'},
114-
{wastedPercent: '<60'},
115-
],
108+
'uses-responsive-images': {
109+
displayValue: 'Potential savings of 75\xa0KB',
110+
details: {
111+
overallSavingsBytes: '>75000',
112+
items: [
113+
{wastedPercent: '<60'},
114+
{wastedPercent: '<60'},
115+
{wastedPercent: '<60'},
116+
],
117+
},
116118
},
117119
},
118120
},
119121
},
120122
{
121-
requestedUrl: 'http://localhost:10200/byte-efficiency/gzip.html',
122-
finalUrl: 'http://localhost:10200/byte-efficiency/gzip.html',
123-
audits: {
124-
'network-requests': {
125-
details: {
126-
items: [
127-
{
128-
url: 'http://localhost:10200/byte-efficiency/gzip.html',
129-
},
130-
{
131-
url: 'http://localhost:10200/byte-efficiency/script.js?gzip=1',
132-
transferSize: 1136,
133-
resourceSize: 52997,
134-
},
135-
{
136-
url: 'http://localhost:10200/byte-efficiency/script.js',
137-
transferSize: 53181,
138-
resourceSize: 52997,
139-
},
140-
],
123+
lhr: {
124+
requestedUrl: 'http://localhost:10200/byte-efficiency/gzip.html',
125+
finalUrl: 'http://localhost:10200/byte-efficiency/gzip.html',
126+
audits: {
127+
'network-requests': {
128+
details: {
129+
items: [
130+
{
131+
url: 'http://localhost:10200/byte-efficiency/gzip.html',
132+
},
133+
{
134+
url: 'http://localhost:10200/byte-efficiency/script.js?gzip=1',
135+
transferSize: 1136,
136+
resourceSize: 52997,
137+
},
138+
{
139+
url: 'http://localhost:10200/byte-efficiency/script.js',
140+
transferSize: 53181,
141+
resourceSize: 52997,
142+
},
143+
],
144+
},
141145
},
142146
},
143147
},

0 commit comments

Comments
 (0)