diff --git a/lighthouse-cli/test/smokehouse/frontends/lib.js b/lighthouse-cli/test/smokehouse/frontends/lib.js index b1f53be7ee97..c48800b8ab68 100644 --- a/lighthouse-cli/test/smokehouse/frontends/lib.js +++ b/lighthouse-cli/test/smokehouse/frontends/lib.js @@ -13,6 +13,7 @@ /* eslint-disable no-console */ +const cloneDeep = require('lodash.clonedeep'); const smokeTests = require('../test-definitions/core-tests.js'); const {runSmokehouse} = require('../smokehouse.js'); @@ -22,8 +23,7 @@ const {runSmokehouse} = require('../smokehouse.js'); async function smokehouse(options) { const {urlFilterRegex, skip, modify, ...smokehouseOptions} = options; - /** @type {Smokehouse.TestDfn[]} */ - const clonedTests = JSON.parse(JSON.stringify(smokeTests)); + const clonedTests = cloneDeep(smokeTests); const modifiedTests = clonedTests.map(test => { const modifiedExpectations = []; for (const expected of test.expectations) { diff --git a/lighthouse-cli/test/smokehouse/smokehouse.js b/lighthouse-cli/test/smokehouse/smokehouse.js index 3ff26a068e6f..e5f9249b2c2d 100644 --- a/lighthouse-cli/test/smokehouse/smokehouse.js +++ b/lighthouse-cli/test/smokehouse/smokehouse.js @@ -144,7 +144,7 @@ async function runSmokeTestDefn(concurrentMapper, smokeTestDefn, defnOptions) { passingTestCount++; } - process.stdout.write(result.log); + console.log(result.log); } console.log(`${purpleify(id)} smoketest complete.`); diff --git a/package.json b/package.json index d0768e65bb3d..a60baa6829cf 100644 --- a/package.json +++ b/package.json @@ -90,6 +90,7 @@ "@types/inquirer": "^0.0.35", "@types/jest": "^24.0.9", "@types/jpeg-js": "^0.3.0", + "@types/lodash.clonedeep": "^4.5.6", "@types/lodash.isequal": "^4.5.2", "@types/lodash.set": "^4.3.6", "@types/node": "*", @@ -128,6 +129,7 @@ "jest": "^24.9.0", "jsdom": "^12.2.0", "lighthouse-plugin-publisher-ads": "^0.4.1", + "lodash.clonedeep": "^4.5.0", "npm-run-posix-or-windows": "^2.0.2", "nyc": "^13.3.0", "package-json-versionify": "^1.0.4", diff --git a/yarn.lock b/yarn.lock index ae614a6e8542..83beddef06e3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -569,6 +569,13 @@ resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.3.tgz#bdfd69d61e464dcc81b25159c270d75a73c1a636" integrity sha512-Il2DtDVRGDcqjDtE+rF8iqg1CArehSK84HZJCT7AMITlyXRBpuPhqGLDQMowraqqu1coEaimg4ZOqggt6L6L+A== +"@types/lodash.clonedeep@^4.5.6": + version "4.5.6" + resolved "https://registry.yarnpkg.com/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.6.tgz#3b6c40a0affe0799a2ce823b440a6cf33571d32b" + integrity sha512-cE1jYr2dEg1wBImvXlNtp0xDoS79rfEdGozQVgliDZj1uERH4k+rmEMTudP9b4VQ8O6nRb5gPqft0QzEQGMQgA== + dependencies: + "@types/lodash" "*" + "@types/lodash.isequal@^4.5.2": version "4.5.2" resolved "https://registry.yarnpkg.com/@types/lodash.isequal/-/lodash.isequal-4.5.2.tgz#adbdff67f7c956ed703009e5466a34eeddb0b712" @@ -5231,6 +5238,11 @@ lodash.assign@^4.2.0: resolved "https://registry.yarnpkg.com/lodash.assign/-/lodash.assign-4.2.0.tgz#0d99f3ccd7a6d261d19bdaeb9245005d285808e7" integrity sha1-DZnzzNem0mHRm9rrkkUAXShYCOc= +lodash.clonedeep@^4.5.0: + version "4.5.0" + resolved "https://registry.yarnpkg.com/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz#e23f3f9c4f8fbdde872529c1071857a086e5ccef" + integrity sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8= + lodash.defaults@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"