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

test(smokehouse): fix flakiness of smokehouse dom-size expectation #1881

Merged
merged 1 commit into from Mar 21, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lighthouse-cli/test/smokehouse/pwa-expectations.js
Expand Up @@ -83,7 +83,7 @@ module.exports = [
extendedInfo: {
value: {
1: {value: '20'},
2: {snippet: 'Element with most children:\nul#versionlist.'}
2: {snippet: /ul.versionlist/}
}
}
},
Expand Down
6 changes: 5 additions & 1 deletion lighthouse-cli/test/smokehouse/smokehouse.js
Expand Up @@ -111,9 +111,13 @@ function findDifference(path, actual, expected) {
return null;
}

if (typeof actual === 'string' && expected instanceof RegExp && expected.test(actual)) {
return null;
}

// If they aren't both an object we can't recurse further, so this is the difference.
if (actual === null || expected === null || typeof actual !== 'object' ||
typeof expected !== 'object') {
typeof expected !== 'object' || expected instanceof RegExp) {
return {
path,
actual,
Expand Down