From eb04363c56384b60328ee0bc7306113cb64eac6f Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 7 Oct 2021 14:48:59 -0700 Subject: [PATCH 1/2] tests(smoke): make specific assertions about deprecations --- .../dobetterweb/dbw-expectations.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js b/lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js index d6385195e3d9..49cb6078556a 100644 --- a/lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js +++ b/lighthouse-cli/test/smokehouse/test-definitions/dobetterweb/dbw-expectations.js @@ -314,12 +314,18 @@ const expectations = { 'deprecations': { score: 0, details: { - items: { - // =2', - }, + items: [ + { + value: /Application Cache API manifest/, + _maxChromiumMilestone: 94, + }, + { + value: /'window.webkitStorageInfo' is deprecated/, + }, + { + value: /Synchronous XMLHttpRequest on the main thread is deprecated/, + }, + ], }, }, 'password-inputs-can-be-pasted-into': { From 6c2f021107263fdf08fb0d6d62d9175a7c83eb88 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 7 Oct 2021 15:09:06 -0700 Subject: [PATCH 2/2] report --- .../test/smokehouse/report-assert.js | 24 +++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/report-assert.js b/lighthouse-cli/test/smokehouse/report-assert.js index 0cb845cfe401..036fd7460738 100644 --- a/lighthouse-cli/test/smokehouse/report-assert.js +++ b/lighthouse-cli/test/smokehouse/report-assert.js @@ -200,26 +200,42 @@ function pruneExpectations(localConsole, lhr, expected, reportOptions) { JSON.stringify(value, null, 2), `Actual Chromium version: ${getChromeVersion()}`, ].join(' ')); - delete obj[key]; + if (Array.isArray(obj)) { + obj.splice(Number(key), 1); + } else { + delete obj[key]; + } } else if (value._legacyOnly && isFraggleRock) { localConsole.log([ `[${key}] marked legacy only but run is Fraggle Rock, pruning expectation:`, JSON.stringify(value, null, 2), ].join(' ')); - delete obj[key]; + if (Array.isArray(obj)) { + obj.splice(Number(key), 1); + } else { + delete obj[key]; + } } else if (value._fraggleRockOnly && !isFraggleRock) { localConsole.log([ `[${key}] marked Fraggle Rock only but run is legacy, pruning expectation:`, JSON.stringify(value, null, 2), `Actual channel: ${lhr.configSettings.channel}`, ].join(' ')); - delete obj[key]; + if (Array.isArray(obj)) { + obj.splice(Number(key), 1); + } else { + delete obj[key]; + } } else if (value._skipInBundled && !isBundled) { localConsole.log([ `[${key}] marked as skip in bundled and runner is bundled, pruning expectation:`, JSON.stringify(value, null, 2), ].join(' ')); - delete obj[key]; + if (Array.isArray(obj)) { + obj.splice(Number(key), 1); + } else { + delete obj[key]; + } } else { pruneRecursively(value); }