Skip to content

Commit

Permalink
core(script-treemap-data): correct value for size (#13716)
Browse files Browse the repository at this point in the history
  • Loading branch information
connorjclark committed Mar 2, 2022
1 parent cded21a commit d684e76
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lighthouse-core/audits/script-treemap-data.js
Expand Up @@ -197,7 +197,7 @@ class ScriptTreemapDataAudit extends Audit {

nodes.push({
name,
resourceBytes: scriptElement.src.length,
resourceBytes: scriptElement.content?.length || 0,
});
continue;
}
Expand Down
Expand Up @@ -5795,7 +5795,7 @@ Array [
},
Object {
"name": "https://sqoosh.app/no-map-or-usage.js",
"resourceBytes": 37,
"resourceBytes": 5,
},
]
`;
4 changes: 2 additions & 2 deletions lighthouse-core/test/audits/script-treemap-data-test.js
Expand Up @@ -64,7 +64,7 @@ describe('ScriptTreemapData audit', () => {
.toMatchInlineSnapshot(`
Object {
"name": "https://sqoosh.app/no-map-or-usage.js",
"resourceBytes": 37,
"resourceBytes": 5,
}
`);

Expand All @@ -79,7 +79,7 @@ describe('ScriptTreemapData audit', () => {
}
`);

expect(JSON.stringify(treemapData.nodes).length).toMatchInlineSnapshot(`6674`);
expect(JSON.stringify(treemapData.nodes).length).toMatchInlineSnapshot(`6673`);
expect(treemapData.nodes).toMatchSnapshot();
});
});
Expand Down
6 changes: 3 additions & 3 deletions lighthouse-core/test/results/sample_v2.json
Expand Up @@ -3241,15 +3241,15 @@
},
{
"name": "http://localhost:10200/dobetterweb/empty_module.js?delay=500",
"resourceBytes": 60
"resourceBytes": 0
},
{
"name": "http://localhost:10200/dobetterweb/fake-script-wp-includes",
"resourceBytes": 58
"resourceBytes": 0
},
{
"name": "http://localhost:10200/dobetterweb/fcp-delayer.js?delay=5000",
"resourceBytes": 60
"resourceBytes": 0
},
{
"name": "http://localhost:10200/dobetterweb/third_party/aggressive-promise-polyfill.js",
Expand Down

0 comments on commit d684e76

Please sign in to comment.