diff --git a/lighthouse-core/test/report/proto-test.js b/lighthouse-core/test/report/proto-test.js index 8282ffbf3d..2c13b20ef1 100644 --- a/lighthouse-core/test/report/proto-test.js +++ b/lighthouse-core/test/report/proto-test.js @@ -21,23 +21,10 @@ describe('round trip JSON comparison subsets', () => { sampleJson = JSON.parse(preprocessor.processForProto(sample)); }); - it('has the same audit results sans details', () => { - Object.keys(sampleJson.audits).forEach(audit => { - delete sampleJson.audits[audit].details; - }); - - expect(roundTripJson.audits).toMatchObject(sampleJson.audits); - }); - - it('has the same audit results & details if applicable', () => { - Object.keys(sampleJson.audits).forEach(auditId => { - expect(roundTripJson.audits[auditId]).toMatchObject(sampleJson.audits[auditId]); - - if ('details' in sampleJson.audits[auditId]) { - expect(roundTripJson.audits[auditId].details) - .toMatchObject(sampleJson.audits[auditId].details); - } - }); + it('has the same audit results and details (if applicable)', () => { + for (const auditId of Object.keys(sampleJson.audits)) { + expect(roundTripJson.audits[auditId]).toEqual(sampleJson.audits[auditId]); + } }); it('has the same i18n rendererFormattedStrings', () => { diff --git a/package.json b/package.json index 2014e47148..5b92e60b38 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,7 @@ "ultradumbBenchmark": "./lighthouse-core/scripts/benchmark.js", "mixed-content": "./lighthouse-cli/index.js --chrome-flags='--headless' --preset=mixed-content", "minify-latest-run": "./lighthouse-core/scripts/lantern/minify-trace.js ./latest-run/defaultPass.trace.json ./latest-run/defaultPass.trace.min.json && ./lighthouse-core/scripts/lantern/minify-devtoolslog.js ./latest-run/defaultPass.devtoolslog.json ./latest-run/defaultPass.devtoolslog.min.json", - "compile-proto": "[ \"$(protoc --version)\" == 'libprotoc 3.6.1' ] && protoc --python_out=./ ./proto/lighthouse-result.proto && mv ./proto/*_pb2.py ./proto/scripts || (echo \"❌ Install protobuf to compile the proto file.\" && false)", + "compile-proto": "protoc --python_out=./ ./proto/lighthouse-result.proto && mv ./proto/*_pb2.py ./proto/scripts || (echo \"❌ Install protobuf ≥ 3.7.1 to compile the proto file.\" && false)", "build-proto-roundtrip": "cd proto/scripts && PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2 python json_roundtrip_via_proto.py" }, "devDependencies": {