From 046bae7f091c06466cffafb32a8d930128fe5dae Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 4 May 2023 09:43:00 -0700 Subject: [PATCH] fix test bitrot --- core/legacy/config/config.js | 2 +- core/test/gather/driver/execution-context-test.js | 1 + core/test/lib/asset-saver-test.js | 4 +++- core/test/runner-test.js | 4 ++-- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/core/legacy/config/config.js b/core/legacy/config/config.js index af55d7c33d96..d5de3e613006 100644 --- a/core/legacy/config/config.js +++ b/core/legacy/config/config.js @@ -205,7 +205,7 @@ class LegacyResolvedConfig { } /** - * @deprecated `Config.fromJson` should be used instead. + * @deprecated `LegacyResolvedConfig.fromJson` should be used instead. * @constructor * @param {LH.Config} config * @param {{settings: LH.Config.Settings, passes: ?LH.Config.Pass[], audits: ?LH.Config.AuditDefn[]}} opts diff --git a/core/test/gather/driver/execution-context-test.js b/core/test/gather/driver/execution-context-test.js index 7d54037140b3..c8e2d5bdc904 100644 --- a/core/test/gather/driver/execution-context-test.js +++ b/core/test/gather/driver/execution-context-test.js @@ -209,6 +209,7 @@ describe('.evaluateAsync', () => { .mockResponse('Page.enable') .mockResponse('Runtime.enable') .mockResponse('Page.getResourceTree', {frameTree: {frame: {id: '1337'}}}) + .mockResponse('Page.getFrameTree', {frameTree: {frame: {id: '1337'}}}) .mockResponse('Page.createIsolatedWorld', {executionContextId: 9001}) .mockResponse('Runtime.evaluate', {exceptionDetails}); diff --git a/core/test/lib/asset-saver-test.js b/core/test/lib/asset-saver-test.js index 8bad973a7ed6..77e0be149795 100644 --- a/core/test/lib/asset-saver-test.js +++ b/core/test/lib/asset-saver-test.js @@ -370,7 +370,9 @@ describe('asset-saver helper', () => { // Use an LighthouseError that has an ICU replacement. const protocolMethod = 'Page.getFastness'; const lhError = new LighthouseError( - LighthouseError.errors.PROTOCOL_TIMEOUT, {protocolMethod}, new Error('the cause')); + LighthouseError.errors.PROTOCOL_TIMEOUT, + {protocolMethod}, + {cause: new Error('the cause')}); const artifacts = { traces: {}, diff --git a/core/test/runner-test.js b/core/test/runner-test.js index 2aebeaf45ddc..1f40a1855e82 100644 --- a/core/test/runner-test.js +++ b/core/test/runner-test.js @@ -610,7 +610,7 @@ describe('Runner', () => { it('produces an error audit result that prefers cause stack', async () => { const errorMessage = 'Audit yourself'; - const config = await Config.fromJson({ + const resolvedConfig = await LegacyResolvedConfig.fromJson({ settings: { auditMode: moduleDir + '/fixtures/artifacts/empty-artifacts/', }, @@ -629,7 +629,7 @@ describe('Runner', () => { ], }); - return runGatherAndAudit({}, {config}).then(results => { + return runGatherAndAudit({}, {resolvedConfig}).then(results => { const auditResult = results.lhr.audits['throwy-audit']; assert.strictEqual(auditResult.score, null); assert.strictEqual(auditResult.scoreDisplayMode, 'error');