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

DBW: collecting no stylesheets is not an error #864

Merged
merged 1 commit into from
Oct 31, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lighthouse-core/gather/gatherers/styles.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class Styles extends Gatherer {
endStylesCollect(driver) {
return new Promise((resolve, reject) => {
if (!this._activeStyleSheetIds.length) {
reject(new Error('No active stylesheets were collected.'));
resolve([]);
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ describe('Page does not use old CSS flexbox', () => {
assert.equal(auditResult.debugString, debugString);
});

it('passes when no stylesheets were collected on the page', () => {
const auditResult = NoOldFlexboxAudit.audit({
Styles: []
});
assert.equal(auditResult.rawValue, true);
assert.equal(auditResult.extendedInfo.value.length, 0);
});

it('fails when display: box is used', () => {
const auditResult = NoOldFlexboxAudit.audit({
Styles: stylesData
Expand Down