From 135bf39ceddda1327dc300d33fdbc4631742841c Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 12 Sep 2019 17:57:25 -0700 Subject: [PATCH 1/5] use array for console log expectations --- .../dobetterweb/dbw-expectations.js | 45 +++++++++++++++++-- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js index 2a2597af72c7..fa283ece8639 100644 --- a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js +++ b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js @@ -81,9 +81,48 @@ module.exports = [ 'errors-in-console': { score: 0, details: { - items: { - length: 8, - }, + items: [ + { + source: 'network', + description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', + url: 'http://localhost:10200/dobetterweb/dobetterweb/dbw_tester.css?delay=100', + }, + { + source: 'network', + description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', + url: 'http://localhost:10200/dobetterweb/unknown404.css?delay=200', + }, + { + source: 'other', + description: 'Application Cache Error event: Manifest fetch failed (404) http://localhost:10200/dobetterweb/clock.appcache', + url: 'http://localhost:10200/dobetterweb/dbw_tester.html', + }, + { + source: 'network', + description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', + url: 'http://localhost:10200/dobetterweb/fcp-delayer.js?delay=5000', + }, + { + source: 'network', + description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', + url: 'http://localhost:10200/favicon.ico', + }, + { + source: 'network', + description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', + url: 'http://localhost:10200/dobetterweb/dobetterweb/dbw_tester.css?delay=100', + }, + { + source: 'network', + description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', + url: 'http://localhost:10200/dobetterweb/unknown404.css?delay=200', + }, + { + source: 'Runtime.exception', + description: 'Error: An error\n at http://localhost:10200/dobetterweb/dbw_tester.html:57:38', + url: 'http://localhost:10200/dobetterweb/dbw_tester.html', + }, + ], }, }, 'is-on-https': { From 40c5a420772ca7d409e057a5cebf687f46a9416b Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 12 Sep 2019 18:04:53 -0700 Subject: [PATCH 2/5] fix --- .../test/fixtures/dobetterweb/dbw_tester.html | 2 +- .../smokehouse/dobetterweb/dbw-expectations.js | 14 ++------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html b/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html index ab1808632a59..950154d46301 100644 --- a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html +++ b/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html @@ -30,7 +30,7 @@ - + diff --git a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js index fa283ece8639..c6a86c2d975e 100644 --- a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js +++ b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js @@ -20,7 +20,7 @@ module.exports = [ { tag: { tagName: 'LINK', - url: 'http://localhost:10200/dobetterweb/dobetterweb/dbw_tester.css?delay=100', + url: 'http://localhost:10200/dobetterweb/dbw_tester.css?delay=100', }, }, { @@ -82,11 +82,6 @@ module.exports = [ score: 0, details: { items: [ - { - source: 'network', - description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', - url: 'http://localhost:10200/dobetterweb/dobetterweb/dbw_tester.css?delay=100', - }, { source: 'network', description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', @@ -107,11 +102,6 @@ module.exports = [ description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', url: 'http://localhost:10200/favicon.ico', }, - { - source: 'network', - description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', - url: 'http://localhost:10200/dobetterweb/dobetterweb/dbw_tester.css?delay=100', - }, { source: 'network', description: 'Failed to load resource: the server responded with a status of 404 (Not Found)', @@ -182,7 +172,7 @@ module.exports = [ details: { items: [ { - url: 'http://localhost:10200/dobetterweb/dobetterweb/dbw_tester.css?delay=100', + url: 'http://localhost:10200/dobetterweb/dbw_tester.css?delay=100', }, { url: 'http://localhost:10200/dobetterweb/unknown404.css?delay=200', From 3b97c84ad0e75cdd7798a5bda82b2be6e5818858 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 12 Sep 2019 18:16:12 -0700 Subject: [PATCH 3/5] kill max-len for expectations --- .eslintrc.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index f2483a6a6785..937d50ad4cbd 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -73,6 +73,14 @@ module.exports = { 'valid-jsdoc': 0, 'arrow-parens': 0, }, + overrides: [ + { + files: ['*expectations.js'], + rules: { + 'max-len': 0, + }, + }, + ], parserOptions: { ecmaVersion: 2018, ecmaFeatures: { From 25ce61e4acc79bd2e3288405baa9fd3a7b436475 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Fri, 13 Sep 2019 10:38:31 -0700 Subject: [PATCH 4/5] narrow --- .eslintrc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.eslintrc.js b/.eslintrc.js index 937d50ad4cbd..6d28a329d05b 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -75,7 +75,7 @@ module.exports = { }, overrides: [ { - files: ['*expectations.js'], + files: ['lighthouse-cli/test/smokehouse/**/*expectations.js'], rules: { 'max-len': 0, }, From 8f36c8f7ed8972d6aa128cd45d9c5ba72d3b9277 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 17 Sep 2019 15:39:48 -0700 Subject: [PATCH 5/5] rm --- lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html b/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html index 950154d46301..c17f26c5ac49 100644 --- a/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html +++ b/lighthouse-cli/test/fixtures/dobetterweb/dbw_tester.html @@ -30,7 +30,7 @@ - +