diff --git a/.eslintrc.js b/.eslintrc.js index 17ab42a325..c72f7b9b57 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -293,6 +293,7 @@ module.exports = { 'rulesdir/check-test-definitions' : 'error', 'rulesdir/no-assert-equal' : 'error', + 'rulesdir/no-assert-deep-strict-equal' : 'error', 'rulesdir/no-repeated-tests' : 'error', 'rulesdir/compare-arrays-with-assert-deepequal' : 'error', 'rulesdir/no-screenshot-test-outside-perf-panel' : 'error', diff --git a/front_end/core/host/AidaClient.test.ts b/front_end/core/host/AidaClient.test.ts index b5ec3a7b1d..210080c77a 100644 --- a/front_end/core/host/AidaClient.test.ts +++ b/front_end/core/host/AidaClient.test.ts @@ -12,7 +12,7 @@ describeWithEnvironment('AidaClient', () => { it('adds no model temperature if console insights is not enabled', () => { const stub = getGetHostConfigStub({}); const request = Host.AidaClient.AidaClient.buildConsoleInsightsRequest('foo'); - assert.deepStrictEqual(request, { + assert.deepEqual(request, { current_message: {parts: [{text: 'foo'}], role: Host.AidaClient.Role.USER}, client: 'CHROME_DEVTOOLS', client_feature: 1, @@ -29,7 +29,7 @@ describeWithEnvironment('AidaClient', () => { }, }); const request = Host.AidaClient.AidaClient.buildConsoleInsightsRequest('foo'); - assert.deepStrictEqual(request, { + assert.deepEqual(request, { current_message: {parts: [{text: 'foo'}], role: Host.AidaClient.Role.USER}, client: 'CHROME_DEVTOOLS', options: { @@ -49,7 +49,7 @@ describeWithEnvironment('AidaClient', () => { }, }); const request = Host.AidaClient.AidaClient.buildConsoleInsightsRequest('foo'); - assert.deepStrictEqual(request, { + assert.deepEqual(request, { current_message: {parts: [{text: 'foo'}], role: Host.AidaClient.Role.USER}, client: 'CHROME_DEVTOOLS', options: { @@ -69,7 +69,7 @@ describeWithEnvironment('AidaClient', () => { }, }); const request = Host.AidaClient.AidaClient.buildConsoleInsightsRequest('foo'); - assert.deepStrictEqual(request, { + assert.deepEqual(request, { current_message: {parts: [{text: 'foo'}], role: Host.AidaClient.Role.USER}, client: 'CHROME_DEVTOOLS', client_feature: 1, @@ -87,7 +87,7 @@ describeWithEnvironment('AidaClient', () => { }, }); const request = Host.AidaClient.AidaClient.buildConsoleInsightsRequest('foo'); - assert.deepStrictEqual(request, { + assert.deepEqual(request, { current_message: {parts: [{text: 'foo'}], role: Host.AidaClient.Role.USER}, client: 'CHROME_DEVTOOLS', options: { @@ -111,7 +111,7 @@ describeWithEnvironment('AidaClient', () => { }, }); const request = Host.AidaClient.AidaClient.buildConsoleInsightsRequest('foo'); - assert.deepStrictEqual(request, { + assert.deepEqual(request, { current_message: {parts: [{text: 'foo'}], role: Host.AidaClient.Role.USER}, client: 'CHROME_DEVTOOLS', metadata: { @@ -153,7 +153,7 @@ describeWithEnvironment('AidaClient', () => { const provider = new Host.AidaClient.AidaClient(); const results = await getAllResults(provider); - assert.deepStrictEqual(results, [ + assert.deepEqual(results, [ { explanation: 'hello ', metadata: {rpcGlobalId: 123}, @@ -191,7 +191,7 @@ describeWithEnvironment('AidaClient', () => { const provider = new Host.AidaClient.AidaClient(); const results = await getAllResults(provider); - assert.deepStrictEqual(results, [ + assert.deepEqual(results, [ { explanation: 'hello world', metadata: {rpcGlobalId: 123}, @@ -233,7 +233,7 @@ describeWithEnvironment('AidaClient', () => { const provider = new Host.AidaClient.AidaClient(); const results = await getAllResults(provider); - assert.deepStrictEqual(results, [ + assert.deepEqual(results, [ { explanation: 'Friends, Romans, countrymen, lend me your ears;\n' + 'I come to bury Caesar, not to praise him.\n', @@ -313,7 +313,7 @@ describeWithEnvironment('AidaClient', () => { const provider = new Host.AidaClient.AidaClient(); const results = await getAllResults(provider); - assert.deepStrictEqual(results, [ + assert.deepEqual(results, [ { explanation: 'Chunk1\n' + 'Chunk2\n', @@ -391,7 +391,7 @@ describeWithEnvironment('AidaClient', () => { const provider = new Host.AidaClient.AidaClient(); const results = (await getAllResults(provider)).map(r => r.explanation); - assert.deepStrictEqual(results, [ + assert.deepEqual(results, [ 'hello ', 'hello \n`````\nbrave \n`````\n', 'hello \n`````\nbrave new World()\n`````\n', diff --git a/front_end/core/platform/ArrayUtilities.test.ts b/front_end/core/platform/ArrayUtilities.test.ts index 3b9c70b6ad..2b4528ffaf 100644 --- a/front_end/core/platform/ArrayUtilities.test.ts +++ b/front_end/core/platform/ArrayUtilities.test.ts @@ -27,12 +27,11 @@ describe('ArrayUtilities', () => { const actualFirstOnlyTrue = [...testCase.input]; Platform.ArrayUtilities.removeElement(actualFirstOnlyTrue, 2, true); - assert.deepStrictEqual(actualFirstOnlyTrue, testCase.expectedFirstOnlyTrue, 'Removing firstOnly (true) failed'); + assert.deepEqual(actualFirstOnlyTrue, testCase.expectedFirstOnlyTrue, 'Removing firstOnly (true) failed'); const actualFirstOnlyFalse = [...testCase.input]; Platform.ArrayUtilities.removeElement(actualFirstOnlyFalse, 2, false); - assert.deepStrictEqual( - actualFirstOnlyFalse, testCase.expectedFirstOnlyFalse, 'Removing firstOnly (false) failed'); + assert.deepEqual(actualFirstOnlyFalse, testCase.expectedFirstOnlyFalse, 'Removing firstOnly (false) failed'); } }); }); @@ -54,20 +53,20 @@ describe('ArrayUtilities', () => { for (let count = 1, k = right - first + 1; count <= k; ++count) { const actual = fixture.slice(0); Platform.ArrayUtilities.sortRange(actual, comparator, left, right, first, first + count - 1); - assert.deepStrictEqual( + assert.deepEqual( fixture.slice(0, left), actual.slice(0, left), 'left ' + left + ' ' + right + ' ' + count); - assert.deepStrictEqual( + assert.deepEqual( fixture.slice(right + 1), actual.slice(right + 1), 'right ' + left + ' ' + right + ' ' + count); const middle = fixture.slice(left, right + 1); middle.sort(comparator); - assert.deepStrictEqual( + assert.deepEqual( middle.slice(first - left, first - left + count), actual.slice(first, first + count), 'sorted ' + left + ' ' + right + ' ' + first + ' ' + count); const actualRest = actual.slice(first + count, right + 1); actualRest.sort(comparator); - assert.deepStrictEqual( + assert.deepEqual( middle.slice(first - left + count), actualRest, 'unsorted ' + left + ' ' + right + ' ' + first + ' ' + count); } @@ -137,7 +136,7 @@ describe('ArrayUtilities', () => { } const shallowCopy = [...actual]; - assert.deepStrictEqual(actual.sort(), shallowCopy, 'Result array is ordered'); + assert.deepEqual(actual.sort(), shallowCopy, 'Result array is ordered'); } const fixtures = new Map([ diff --git a/front_end/core/root/Runtime.test.ts b/front_end/core/root/Runtime.test.ts index 7069afa768..a462215d83 100644 --- a/front_end/core/root/Runtime.test.ts +++ b/front_end/core/root/Runtime.test.ts @@ -42,6 +42,6 @@ describe('Runtime', () => { const experiments = Root.Runtime.experiments.allConfigurableExperiments(); - assert.deepStrictEqual(experiments.map(experiment => experiment.name), ['example', 'configurable']); + assert.deepEqual(experiments.map(experiment => experiment.name), ['example', 'configurable']); }); }); diff --git a/front_end/core/sdk/AutofillModel.test.ts b/front_end/core/sdk/AutofillModel.test.ts index 10b32a45a3..0556f264bd 100644 --- a/front_end/core/sdk/AutofillModel.test.ts +++ b/front_end/core/sdk/AutofillModel.test.ts @@ -79,6 +79,6 @@ describeWithMockConnection('AutofillModel', () => { }; autofillModel!.addressFormFilled(addressFormFilledEvent); assert.lengthOf(dispatchedEvents, 1); - assert.deepStrictEqual(dispatchedEvents[0].event, addressFormFilledEvent); + assert.deepEqual(dispatchedEvents[0].event, addressFormFilledEvent); }); }); diff --git a/front_end/core/sdk/CSSMatchedStyles.test.ts b/front_end/core/sdk/CSSMatchedStyles.test.ts index d4d3d131c0..781494bb31 100644 --- a/front_end/core/sdk/CSSMatchedStyles.test.ts +++ b/front_end/core/sdk/CSSMatchedStyles.test.ts @@ -398,13 +398,12 @@ describe('CSSMatchedStyles', () => { inheritedPayload, }); - assert.deepStrictEqual( - matchedStyles.nodeStyles().map(style => style.allProperties().map(prop => prop.propertyText)), [ - ['--var: red;'], - ['color: var(--var);'], - ['--var: blue;'], - ['--var: red;'], - ]); + assert.deepEqual(matchedStyles.nodeStyles().map(style => style.allProperties().map(prop => prop.propertyText)), [ + ['--var: red;'], + ['color: var(--var);'], + ['--var: blue;'], + ['--var: red;'], + ]); }); describe('resolveGlobalKeyword', () => { diff --git a/front_end/core/sdk/CookieModel.test.ts b/front_end/core/sdk/CookieModel.test.ts index 0be7e2c0ea..c968be7af4 100644 --- a/front_end/core/sdk/CookieModel.test.ts +++ b/front_end/core/sdk/CookieModel.test.ts @@ -197,7 +197,7 @@ describeWithMockConnection('CookieModel', () => { cookieModel.addBlockedCookie(cookie, [blockedReason]); const cookieToBlockedReasons = cookieModel.getCookieToBlockedReasonsMap(); assert.strictEqual(cookieToBlockedReasons.size, 1); - assert.deepStrictEqual(cookieToBlockedReasons.get(cookie), [blockedReason]); + assert.deepEqual(cookieToBlockedReasons.get(cookie), [blockedReason]); navigate(getMainFrame(target)); assert.strictEqual(cookieModel.getCookieToBlockedReasonsMap().size, 0); diff --git a/front_end/core/sdk/DebuggerModel.test.ts b/front_end/core/sdk/DebuggerModel.test.ts index a9b1a40e7e..346ec869cc 100644 --- a/front_end/core/sdk/DebuggerModel.test.ts +++ b/front_end/core/sdk/DebuggerModel.test.ts @@ -327,7 +327,7 @@ describe('DebuggerModel', () => { } assert.lengthOf(consoleMessages, 1); - assert.deepStrictEqual(consoleMessages[0].text, expectedWarning); + assert.deepEqual(consoleMessages[0].text, expectedWarning); } it('prioritizes external DWARF over all types', () => { diff --git a/front_end/core/sdk/FrameManager.test.ts b/front_end/core/sdk/FrameManager.test.ts index 89afbc2142..13ef38ecd1 100644 --- a/front_end/core/sdk/FrameManager.test.ts +++ b/front_end/core/sdk/FrameManager.test.ts @@ -102,7 +102,7 @@ describe('FrameManager', () => { addMockFrame(mockModel, frameId); const frameIds = dispatchedEvents.map(event => event.data.frame.id); - assert.deepStrictEqual(frameIds, [frameId]); + assert.deepEqual(frameIds, [frameId]); const frameFromId = frameManager.getFrame(frameId); assert.strictEqual(frameFromId?.id, frameId); }); diff --git a/front_end/core/sdk/NetworkManager.test.ts b/front_end/core/sdk/NetworkManager.test.ts index cdbc1f2d2d..5fd0223d7c 100644 --- a/front_end/core/sdk/NetworkManager.test.ts +++ b/front_end/core/sdk/NetworkManager.test.ts @@ -1103,6 +1103,6 @@ describeWithMockConnection('InterceptedRequest', () => { {name: 'set-cookie', value: 'override_duplicate'}, {name: 'set-cookie', value: 'malformed_override'}, ]; - assert.deepStrictEqual(SDK.NetworkManager.InterceptedRequest.mergeSetCookieHeaders(original, overrides), expected); + assert.deepEqual(SDK.NetworkManager.InterceptedRequest.mergeSetCookieHeaders(original, overrides), expected); }); }); diff --git a/front_end/core/sdk/NetworkRequest.test.ts b/front_end/core/sdk/NetworkRequest.test.ts index fe9d2e5040..1f8a6f08de 100644 --- a/front_end/core/sdk/NetworkRequest.test.ts +++ b/front_end/core/sdk/NetworkRequest.test.ts @@ -293,7 +293,7 @@ describeWithMockConnection('NetworkRequest', () => { 'Setting this cookie was blocked either because of Chrome flags or browser configuration. Learn more in the Issues panel.', }, ])); - assert.deepStrictEqual(await cookieModel.getCookiesForDomain(''), [cookie]); + assert.deepEqual(await cookieModel.getCookiesForDomain(''), [cookie]); request.addExtraResponseInfo({ responseHeaders: [{name: 'Set-Cookie', value: 'name=value; Path=/'}], @@ -358,8 +358,8 @@ describeWithMockConnection('ServerSentEvents', () => { }); assert.lengthOf(networkEvents, 2); - assert.deepStrictEqual(networkEvents[0], {data: 'foo', eventId: 'fooId', eventName: 'fooName', time: 21}); - assert.deepStrictEqual(networkEvents[1], {data: 'bar', eventId: 'barId', eventName: 'barName', time: 42}); + assert.deepEqual(networkEvents[0], {data: 'foo', eventId: 'fooId', eventName: 'fooName', time: 21}); + assert.deepEqual(networkEvents[1], {data: 'bar', eventId: 'barId', eventName: 'barName', time: 42}); }); it('sends EventSourceMessageAdded events for raw text/event-stream', async () => { diff --git a/front_end/core/sdk/ResourceTreeModel.test.ts b/front_end/core/sdk/ResourceTreeModel.test.ts index c8fe303052..3e8e55ed8c 100644 --- a/front_end/core/sdk/ResourceTreeModel.test.ts +++ b/front_end/core/sdk/ResourceTreeModel.test.ts @@ -116,7 +116,7 @@ describeWithMockConnection('ResourceTreeModel', () => { assert.isNotNull(resourceTreeModel.mainFrame); resourceTreeModel.reloadPage(); assert.isTrue(reload.calledOnce); - assert.deepStrictEqual( + assert.deepEqual( reload.args[0], [{ignoreCache: undefined, loaderId: LOADER_ID, scriptToEvaluateOnLoad: undefined}]); }); diff --git a/front_end/core/sdk/ServiceWorkerManager.test.ts b/front_end/core/sdk/ServiceWorkerManager.test.ts index f6aa30f2f1..e07f0772f4 100644 --- a/front_end/core/sdk/ServiceWorkerManager.test.ts +++ b/front_end/core/sdk/ServiceWorkerManager.test.ts @@ -42,9 +42,9 @@ describe('ServiceWorkerVersion', () => { assert.strictEqual(version.status, VERSION_PAYLOAD.status); assert.strictEqual(version.scriptLastModified, VERSION_PAYLOAD.scriptLastModified); assert.strictEqual(version.scriptResponseTime, VERSION_PAYLOAD.scriptResponseTime); - assert.deepStrictEqual(version.controlledClients, VERSION_PAYLOAD.controlledClients); + assert.deepEqual(version.controlledClients, VERSION_PAYLOAD.controlledClients); assert.strictEqual(version.targetId, VERSION_PAYLOAD.targetId); - assert.deepStrictEqual(version.routerRules, expectedRouterRules); + assert.deepEqual(version.routerRules, expectedRouterRules); }); it('should update the version with the given payload', () => { @@ -67,7 +67,7 @@ describe('ServiceWorkerVersion', () => { assert.strictEqual(version.status, 'installing'); assert.strictEqual(version.scriptLastModified, 1234567891); assert.strictEqual(version.scriptResponseTime, 12346); - assert.deepStrictEqual(version.controlledClients, ['client3', 'client4']); + assert.deepEqual(version.controlledClients, ['client3', 'client4']); assert.strictEqual(version.targetId, 'target2'); }); diff --git a/front_end/models/autofill_manager/AutofillManager.test.ts b/front_end/models/autofill_manager/AutofillManager.test.ts index a94d6d0654..fa28fa40e2 100644 --- a/front_end/models/autofill_manager/AutofillManager.test.ts +++ b/front_end/models/autofill_manager/AutofillManager.test.ts @@ -41,7 +41,7 @@ describeWithMockConnection('AutofillManager', () => { SDK.AutofillModel.Events.ADDRESS_FORM_FILLED, {autofillModel: model, event: inEvent}); await new Promise(resolve => setTimeout(resolve, 0)); assert.isTrue(showViewStub.calledOnceWithExactly('autofill-view')); - assert.deepStrictEqual(dispatchedAutofillEvents, [outEvent]); + assert.deepEqual(dispatchedAutofillEvents, [outEvent]); }; it('with a single match', async () => { diff --git a/front_end/models/bindings/DebuggerLanguagePlugins.test.ts b/front_end/models/bindings/DebuggerLanguagePlugins.test.ts index 632e3b4f94..a38ceff520 100644 --- a/front_end/models/bindings/DebuggerLanguagePlugins.test.ts +++ b/front_end/models/bindings/DebuggerLanguagePlugins.test.ts @@ -103,7 +103,7 @@ describe('DebuggerLanguagePlugins', () => { const location = sinon.createStubInstance(SDK.DebuggerModel.Location); const result = await pluginManager.getFunctionInfo(script, location); Platform.assertNotNullOrUndefined(result); - assert.deepStrictEqual(result, {missingSymbolFiles: [MISSING_DEBUG_FILES]}); + assert.deepEqual(result, {missingSymbolFiles: [MISSING_DEBUG_FILES]}); }); it('correctly returns frames if available', async () => { @@ -116,7 +116,7 @@ describe('DebuggerLanguagePlugins', () => { const result = await pluginManager.getFunctionInfo(script, location); Platform.assertNotNullOrUndefined(result); - assert.deepStrictEqual(result, {frames: [{name: FUNCTION_NAME}]}); + assert.deepEqual(result, {frames: [{name: FUNCTION_NAME}]}); }); it('correctly returns frames and missing debug info if both are available', async () => { @@ -130,7 +130,7 @@ describe('DebuggerLanguagePlugins', () => { const result = await pluginManager.getFunctionInfo(script, location); Platform.assertNotNullOrUndefined(result); - assert.deepStrictEqual(result, {frames: [{name: FUNCTION_NAME}], missingSymbolFiles: [MISSING_DEBUG_FILES]}); + assert.deepEqual(result, {frames: [{name: FUNCTION_NAME}], missingSymbolFiles: [MISSING_DEBUG_FILES]}); }); }); }); diff --git a/front_end/models/breakpoints/BreakpointManager.test.ts b/front_end/models/breakpoints/BreakpointManager.test.ts index f6b29bc6bb..5922376cba 100644 --- a/front_end/models/breakpoints/BreakpointManager.test.ts +++ b/front_end/models/breakpoints/BreakpointManager.test.ts @@ -1636,7 +1636,7 @@ describeWithMockConnection('BreakpointManager', () => { // Expect that the breakpoint is only added to the network UI source code. assert.strictEqual(breakpoint, addedBreakpoint); - assert.deepStrictEqual(Array.from(breakpoint.getUiSourceCodes()), [uiSourceCode]); + assert.deepEqual(Array.from(breakpoint.getUiSourceCodes()), [uiSourceCode]); }); it('updates a breakpoint after live editing the underlying script', async () => { diff --git a/front_end/models/crux-manager/CrUXManager.test.ts b/front_end/models/crux-manager/CrUXManager.test.ts index 223098ef8f..a96827a8c3 100644 --- a/front_end/models/crux-manager/CrUXManager.test.ts +++ b/front_end/models/crux-manager/CrUXManager.test.ts @@ -137,7 +137,7 @@ describeWithMockConnection('CrUXManager', () => { .sort() .map(body => JSON.parse(body) as CrUXManager.CrUXRequest); - assert.deepStrictEqual(pageResult, { + assert.deepEqual(pageResult, { 'origin-ALL': mockResponse(), 'origin-DESKTOP': mockResponse(), 'origin-PHONE': mockResponse(), @@ -149,7 +149,7 @@ describeWithMockConnection('CrUXManager', () => { warnings: [], }); - assert.deepStrictEqual(fetchBodies, [ + assert.deepEqual(fetchBodies, [ { formFactor: 'DESKTOP', metrics: [ @@ -222,7 +222,7 @@ describeWithMockConnection('CrUXManager', () => { status: 404, })); const pageResult = await cruxManager.getFieldDataForPage('https://example.com'); - assert.deepStrictEqual(pageResult, { + assert.deepEqual(pageResult, { 'origin-ALL': null, 'origin-DESKTOP': null, 'origin-PHONE': null, @@ -342,7 +342,7 @@ describeWithMockConnection('CrUXManager', () => { const result = await cruxManager.getFieldDataForCurrentPage(); - assert.deepStrictEqual(result.warnings, []); + assert.deepEqual(result.warnings, []); assert.strictEqual(getFieldDataMock.callCount, 1); assert.strictEqual(getFieldDataMock.firstCall.args[0], 'https://example.com/main/'); }); @@ -354,7 +354,7 @@ describeWithMockConnection('CrUXManager', () => { const result = await cruxManager.getFieldDataForCurrentPage(); - assert.deepStrictEqual(result.warnings, ['Field data is configured for a different URL than the current page.']); + assert.deepEqual(result.warnings, ['Field data is configured for a different URL than the current page.']); assert.strictEqual(getFieldDataMock.callCount, 1); assert.strictEqual(getFieldDataMock.firstCall.args[0], 'https://example.com/override'); }); @@ -371,7 +371,7 @@ describeWithMockConnection('CrUXManager', () => { const result = await cruxManager.getFieldDataForCurrentPage(); - assert.deepStrictEqual(result.warnings, ['Field data is configured for a different URL than the current page.']); + assert.deepEqual(result.warnings, ['Field data is configured for a different URL than the current page.']); assert.strictEqual(getFieldDataMock.callCount, 1); assert.strictEqual(getFieldDataMock.firstCall.args[0], 'https://example.com/inspected'); }); @@ -390,7 +390,7 @@ describeWithMockConnection('CrUXManager', () => { const result = await cruxManager.getFieldDataForCurrentPage(); - assert.deepStrictEqual(result.warnings, ['Field data is configured for a different URL than the current page.']); + assert.deepEqual(result.warnings, ['Field data is configured for a different URL than the current page.']); assert.strictEqual(getFieldDataMock.callCount, 1); assert.strictEqual(getFieldDataMock.firstCall.args[0], 'https://google.com'); }); @@ -400,7 +400,7 @@ describeWithMockConnection('CrUXManager', () => { const result = await cruxManager.getFieldDataForCurrentPage(); - assert.deepStrictEqual(result.warnings, []); + assert.deepEqual(result.warnings, []); assert.strictEqual(getFieldDataMock.callCount, 1); assert.strictEqual(getFieldDataMock.firstCall.args[0], 'https://example.com/inspected'); }); @@ -416,7 +416,7 @@ describeWithMockConnection('CrUXManager', () => { const result = await finishPromise; - assert.deepStrictEqual(result.warnings, []); + assert.deepEqual(result.warnings, []); assert.strictEqual(getFieldDataMock.callCount, 1); assert.strictEqual(getFieldDataMock.firstCall.args[0], 'https://example.com/awaitInspected'); }); diff --git a/front_end/models/extensions/ExtensionServer.test.ts b/front_end/models/extensions/ExtensionServer.test.ts index 98a9b1313a..662800db86 100644 --- a/front_end/models/extensions/ExtensionServer.test.ts +++ b/front_end/models/extensions/ExtensionServer.test.ts @@ -72,7 +72,7 @@ describeWithDevtoolsExtension('Extensions', {}, context => { const resources = await new Promise(r => context.chrome.devtools!.inspectedWindow.getResources(r)); - assert.deepStrictEqual(resources.map(r => r.url), ['https://example.com/', 'http://example.com']); + assert.deepEqual(resources.map(r => r.url), ['https://example.com/', 'http://example.com']); }); }); @@ -113,9 +113,9 @@ describeWithDevtoolsExtension('Extensions', {}, context => { assert.strictEqual(manager.plugins().length, 1); assert.strictEqual(manager.plugins()[0].getMediaType(), 'text/javascript'); assert.strictEqual(manager.plugins()[0].getName(), 'Test'); - assert.deepStrictEqual(manager.plugins()[0].getCapabilities(), ['export']); - assert.deepStrictEqual(result, '{"name":"test","steps":[]}'); - assert.deepStrictEqual(stepResult, '{"type":"scroll"}'); + assert.deepEqual(manager.plugins()[0].getCapabilities(), ['export']); + assert.deepEqual(result, '{"name":"test","steps":[]}'); + assert.deepEqual(stepResult, '{"type":"scroll"}'); await context.chrome.devtools?.recorder.unregisterRecorderExtensionPlugin(extensionPlugin); }); @@ -139,7 +139,7 @@ describeWithDevtoolsExtension('Extensions', {}, context => { }); assert.strictEqual(manager.plugins().length, 1); - assert.deepStrictEqual(manager.plugins()[0].getCapabilities(), ['replay']); + assert.deepEqual(manager.plugins()[0].getCapabilities(), ['replay']); assert.strictEqual(manager.plugins()[0].getName(), 'Replay'); await context.chrome.devtools?.recorder.unregisterRecorderExtensionPlugin(extensionPlugin); @@ -193,7 +193,7 @@ describeWithDevtoolsExtension('Extensions', {}, context => { steps: [], }); const viewDescriptor = await onceShowRequested; - assert.deepStrictEqual(viewDescriptor.title, 'Test'); + assert.deepEqual(viewDescriptor.title, 'Test'); await context.chrome.devtools?.recorder.unregisterRecorderExtensionPlugin(extensionPlugin); }); @@ -224,7 +224,7 @@ describeWithDevtoolsExtension('Extensions', {}, context => { // that the ShowViewRequested command was not actually dispatched. await new Promise(resolve => context.chrome.devtools?.inspectedWindow.eval('1', undefined, resolve)); - assert.deepStrictEqual(events, []); + assert.deepEqual(events, []); await context.chrome.devtools?.recorder.unregisterRecorderExtensionPlugin(extensionPlugin); }); @@ -255,7 +255,7 @@ describeWithDevtoolsExtension('Extensions', {}, context => { steps: [], }); const viewDescriptor = await onceShowRequested; - assert.deepStrictEqual(viewDescriptor.title, 'Test'); + assert.deepEqual(viewDescriptor.title, 'Test'); const descriptor = manager.getViewDescriptor(viewDescriptor.id); @@ -301,7 +301,7 @@ describeWithDevtoolsExtension('Extensions', {}, context => { })); target.setInspectedURL('http://example.com' as Platform.DevToolsPath.UrlString); - assert.deepStrictEqual(addExtensionSpy.returnValues, [undefined, true]); + assert.deepEqual(addExtensionSpy.returnValues, [undefined, true]); }); it('correcly reenables extensions after navigation', async () => { @@ -388,11 +388,11 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => const target = createTarget({type: SDK.Target.Type.FRAME}); target.setInspectedURL(blockedUrl); assert.isTrue(addExtensionSpy.calledOnce, 'addExtension called once'); - assert.deepStrictEqual(addExtensionSpy.returnValues, [undefined]); + assert.deepEqual(addExtensionSpy.returnValues, [undefined]); target.setInspectedURL(allowedUrl); assert.isTrue(addExtensionSpy.calledTwice, 'addExtension called twice'); - assert.deepStrictEqual(addExtensionSpy.returnValues, [undefined, true]); + assert.deepEqual(addExtensionSpy.returnValues, [undefined, true]); }); it('does not include blocked hosts in the HAR entries', async () => { @@ -445,7 +445,7 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => r => context.chrome.devtools?.inspectedWindow.eval( '4', {frameURL: childFrameUrl}, (result, error) => r({result, error}))); - assert.deepStrictEqual(result.error?.details, ['Permission denied']); + assert.deepEqual(result.error?.details, ['Permission denied']); }); it('doesn\'t block evaluation on blocked sub-executioncontexts with useContentScriptContext', async () => { @@ -478,7 +478,7 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => r => context.chrome.devtools?.inspectedWindow.eval( '4', {frameURL: childFrameUrl, useContentScriptContext: true}, (result, error) => r({result, error}))); - assert.deepStrictEqual(result.result, 4); + assert.deepEqual(result.result, 4); }); it('blocks evaluation on blocked sub-executioncontexts with explicit scriptExecutionContextOrigin', async () => { @@ -508,7 +508,7 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => '4', {frameURL: childFrameUrl, scriptExecutionContext: childExeContextOrigin} as any, (result, error) => r({result, error}))); - assert.deepStrictEqual(result.error?.details, ['Permission denied']); + assert.deepEqual(result.error?.details, ['Permission denied']); }); it('blocks evaluation on blocked sub-executioncontexts', async () => { @@ -524,7 +524,7 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => r => context.chrome.devtools?.inspectedWindow.eval( '4', {frameURL: childFrameUrl}, (result, error) => r({result, error}))); - assert.deepStrictEqual(result.error?.details, ['Permission denied']); + assert.deepEqual(result.error?.details, ['Permission denied']); }); async function createUISourceCode( @@ -553,13 +553,13 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => assert.exists(context.chrome.devtools); const resources = await new Promise(r => context.chrome.devtools?.inspectedWindow.getResources(r)); - assert.deepStrictEqual(resources.map(r => r.url), [blockedUrl, allowedUrl]); + assert.deepEqual(resources.map(r => r.url), [blockedUrl, allowedUrl]); const resourceContents = await Promise.all(resources.map( resource => new Promise<{url: string, content?: string, encoding?: string}>( r => resource.getContent((content, encoding) => r({url: resource.url, content, encoding}))))); - assert.deepStrictEqual(resourceContents, [ + assert.deepEqual(resourceContents, [ {url: blockedUrl, content: undefined, encoding: undefined}, {url: allowedUrl, content: 'content', encoding: ''}, ]); @@ -618,19 +618,19 @@ describeWithDevtoolsExtension('Runtime hosts policy', {hostsPolicy}, context => assert.exists(context.chrome.devtools); const resources = await new Promise(r => context.chrome.devtools?.inspectedWindow.getResources(r)); - assert.deepStrictEqual(resources.map(r => r.url), [blockedUrl, allowedUrl]); + assert.deepEqual(resources.map(r => r.url), [blockedUrl, allowedUrl]); - assert.deepStrictEqual(project.uiSourceCodeForURL(allowedUrl)?.content(), 'content'); - assert.deepStrictEqual(project.uiSourceCodeForURL(blockedUrl)?.content(), 'content'); + assert.deepEqual(project.uiSourceCodeForURL(allowedUrl)?.content(), 'content'); + assert.deepEqual(project.uiSourceCodeForURL(blockedUrl)?.content(), 'content'); const responses = await Promise.all(resources.map( resource => new Promise(r => resource.setContent('modified', true, r)))) as Array; - assert.deepStrictEqual(responses.map(response => response?.code), ['E_FAILED', 'OK']); - assert.deepStrictEqual(responses.map(response => response?.details), [['Permission denied'], []]); + assert.deepEqual(responses.map(response => response?.code), ['E_FAILED', 'OK']); + assert.deepEqual(responses.map(response => response?.details), [['Permission denied'], []]); - assert.deepStrictEqual(project.uiSourceCodeForURL(allowedUrl)?.content(), 'modified'); - assert.deepStrictEqual(project.uiSourceCodeForURL(blockedUrl)?.content(), 'content'); + assert.deepEqual(project.uiSourceCodeForURL(allowedUrl)?.content(), 'modified'); + assert.deepEqual(project.uiSourceCodeForURL(blockedUrl)?.content(), 'content'); }); }); diff --git a/front_end/models/extensions/RecorderPluginManager.test.ts b/front_end/models/extensions/RecorderPluginManager.test.ts index f4c9c7c9be..adfb7a8637 100644 --- a/front_end/models/extensions/RecorderPluginManager.test.ts +++ b/front_end/models/extensions/RecorderPluginManager.test.ts @@ -20,7 +20,7 @@ describe('RecorderPluginManager', () => { manager.addPlugin(plugin); manager.removePlugin(plugin); - assert.deepStrictEqual(events, [ + assert.deepEqual(events, [ { event: 'pluginAdded', plugin, diff --git a/front_end/models/har/Importer.test.ts b/front_end/models/har/Importer.test.ts index 616c8fe78c..12f19eaf01 100644 --- a/front_end/models/har/Importer.test.ts +++ b/front_end/models/har/Importer.test.ts @@ -206,7 +206,7 @@ describe('HAR Importer', () => { assert.strictEqual(parsedRequest.documentURL, 'https://example.com/api/testEndpoint?param1=test'); assert.strictEqual(parsedRequest.frameId, null); assert.strictEqual(parsedRequest.loaderId, null); - assert.deepStrictEqual( + assert.deepEqual( parsedRequest.initiator() as HAR.HARFormat.HARInitiator, { type: Protocol.Network.InitiatorType.Script, diff --git a/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.test.ts b/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.test.ts index 8661022ddb..96fb03f1cd 100644 --- a/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.test.ts +++ b/front_end/models/issues_manager/FederatedAuthUserInfoRequestIssue.test.ts @@ -44,7 +44,7 @@ describeWithLocale('FederatedAuthUserInfoRequestIssue', () => { const federatedAuthUserInfoRequestIssue = federatedAuthUserInfoRequestIssues[0]; assert.strictEqual(federatedAuthUserInfoRequestIssue.getCategory(), IssuesManager.Issue.IssueCategory.OTHER); - assert.deepStrictEqual(federatedAuthUserInfoRequestIssue.details(), issueDetails); + assert.deepEqual(federatedAuthUserInfoRequestIssue.details(), issueDetails); assert.strictEqual(federatedAuthUserInfoRequestIssue.getKind(), IssuesManager.Issue.IssueKind.PAGE_ERROR); assert.isNotNull(federatedAuthUserInfoRequestIssue.getDescription()); } diff --git a/front_end/models/issues_manager/IssuesManager.test.ts b/front_end/models/issues_manager/IssuesManager.test.ts index a783db48da..2720cde736 100644 --- a/front_end/models/issues_manager/IssuesManager.test.ts +++ b/front_end/models/issues_manager/IssuesManager.test.ts @@ -38,10 +38,10 @@ describeWithMockConnection('IssuesManager', () => { SDK.IssuesModel.Events.ISSUE_ADDED, {issuesModel: model, inspectorIssue: mkInspectorCspIssue('url2')}); const expected = ['ContentSecurityPolicyIssue::kURLViolation', 'ContentSecurityPolicyIssue::kURLViolation']; - assert.deepStrictEqual(dispatchedIssues.map(i => i.code()), expected); + assert.deepEqual(dispatchedIssues.map(i => i.code()), expected); const issueCodes = Array.from(issuesManager.issues()).map(r => r.code()); - assert.deepStrictEqual(issueCodes, expected); + assert.deepEqual(issueCodes, expected); }); function getBlockedUrl(issue: IssuesManager.Issue.Issue): string|undefined { @@ -66,9 +66,9 @@ describeWithMockConnection('IssuesManager', () => { SDK.IssuesModel.Events.ISSUE_ADDED, {issuesModel: prerenderModel, inspectorIssue: mkInspectorCspIssue('url2')}); const expected = ['url1']; - assert.deepStrictEqual(dispatchedIssues.map(getBlockedUrl), expected); + assert.deepEqual(dispatchedIssues.map(getBlockedUrl), expected); - assert.deepStrictEqual(Array.from(issuesManager.issues()).map(getBlockedUrl), expected); + assert.deepEqual(Array.from(issuesManager.issues()).map(getBlockedUrl), expected); return {issuesManager, prerenderTarget}; } @@ -76,7 +76,7 @@ describeWithMockConnection('IssuesManager', () => { const {issuesManager, prerenderTarget} = assertOutOfScopeIssuesAreFiltered(); SDK.TargetManager.TargetManager.instance().setScopeTarget(prerenderTarget); - assert.deepStrictEqual(Array.from(issuesManager.issues()).map(getBlockedUrl), ['url2']); + assert.deepEqual(Array.from(issuesManager.issues()).map(getBlockedUrl), ['url2']); }); it('keeps issues of prerendered page upon activation', () => { @@ -84,7 +84,7 @@ describeWithMockConnection('IssuesManager', () => { SDK.TargetManager.TargetManager.instance().setScopeTarget(prerenderTarget); activate(prerenderTarget); - assert.deepStrictEqual(Array.from(issuesManager.issues()).map(getBlockedUrl), ['url2']); + assert.deepEqual(Array.from(issuesManager.issues()).map(getBlockedUrl), ['url2']); }); const updatesOnPrimaryPageChange = (primary: boolean) => () => { @@ -122,13 +122,13 @@ describeWithMockConnection('IssuesManager', () => { } let issueCodes = Array.from(issuesManager.issues()).map(i => i.code()); - assert.deepStrictEqual(issueCodes, ['AllowedStubIssue1', 'AllowedStubIssue3']); - assert.deepStrictEqual(firedIssueAddedEventCodes, ['AllowedStubIssue1', 'AllowedStubIssue3']); + assert.deepEqual(issueCodes, ['AllowedStubIssue1', 'AllowedStubIssue3']); + assert.deepEqual(firedIssueAddedEventCodes, ['AllowedStubIssue1', 'AllowedStubIssue3']); showThirdPartyIssuesSetting.set(true); issueCodes = Array.from(issuesManager.issues()).map(i => i.code()); - assert.deepStrictEqual(issueCodes, ['AllowedStubIssue1', 'StubIssue2', 'AllowedStubIssue3', 'StubIssue4']); + assert.deepEqual(issueCodes, ['AllowedStubIssue1', 'StubIssue2', 'AllowedStubIssue3', 'StubIssue4']); }); it('reports issue counts by kind', () => { @@ -142,10 +142,10 @@ describeWithMockConnection('IssuesManager', () => { issuesManager.addIssue(model, issue2); issuesManager.addIssue(model, issue3); - assert.deepStrictEqual(issuesManager.numberOfIssues(), 3); - assert.deepStrictEqual(issuesManager.numberOfIssues(IssuesManager.Issue.IssueKind.IMPROVEMENT), 2); - assert.deepStrictEqual(issuesManager.numberOfIssues(IssuesManager.Issue.IssueKind.BREAKING_CHANGE), 1); - assert.deepStrictEqual(issuesManager.numberOfIssues(IssuesManager.Issue.IssueKind.PAGE_ERROR), 0); + assert.deepEqual(issuesManager.numberOfIssues(), 3); + assert.deepEqual(issuesManager.numberOfIssues(IssuesManager.Issue.IssueKind.IMPROVEMENT), 2); + assert.deepEqual(issuesManager.numberOfIssues(IssuesManager.Issue.IssueKind.BREAKING_CHANGE), 1); + assert.deepEqual(issuesManager.numberOfIssues(IssuesManager.Issue.IssueKind.PAGE_ERROR), 0); }); describe('instance', () => { @@ -190,7 +190,7 @@ describeWithMockConnection('IssuesManager', () => { issuesManager.addIssue(model, issue); } - assert.deepStrictEqual(hiddenIssues, ['HiddenStubIssue1', 'HiddenStubIssue2']); + assert.deepEqual(hiddenIssues, ['HiddenStubIssue1', 'HiddenStubIssue2']); }); it('hides issues present in IssuesManager when setting is updated', () => { @@ -222,13 +222,13 @@ describeWithMockConnection('IssuesManager', () => { hideIssueByCodeSetting.set({ HiddenStubIssue1: IssuesManager.IssuesManager.IssueStatus.HIDDEN, }); - assert.deepStrictEqual(hiddenIssues, ['HiddenStubIssue1']); + assert.deepEqual(hiddenIssues, ['HiddenStubIssue1']); hideIssueByCodeSetting.set({ HiddenStubIssue1: IssuesManager.IssuesManager.IssueStatus.HIDDEN, HiddenStubIssue2: IssuesManager.IssuesManager.IssueStatus.HIDDEN, }); - assert.deepStrictEqual(hiddenIssues, ['HiddenStubIssue1', 'HiddenStubIssue2']); + assert.deepEqual(hiddenIssues, ['HiddenStubIssue1', 'HiddenStubIssue2']); }); it('unhides issues present in IssuesManager when setting is updated', () => { @@ -269,7 +269,7 @@ describeWithMockConnection('IssuesManager', () => { UnhiddenStubIssue1: IssuesManager.IssuesManager.IssueStatus.UNHIDDEN, UnhiddenStubIssue2: IssuesManager.IssuesManager.IssueStatus.HIDDEN, }); - assert.deepStrictEqual(unhiddenIssues, ['UnhiddenStubIssue1']); + assert.deepEqual(unhiddenIssues, ['UnhiddenStubIssue1']); hideIssueByCodeSetting.set({ HiddenStubIssue1: IssuesManager.IssuesManager.IssueStatus.HIDDEN, @@ -277,7 +277,7 @@ describeWithMockConnection('IssuesManager', () => { UnhiddenStubIssue1: IssuesManager.IssuesManager.IssueStatus.UNHIDDEN, UnhiddenStubIssue2: IssuesManager.IssuesManager.IssueStatus.UNHIDDEN, }); - assert.deepStrictEqual(unhiddenIssues, ['UnhiddenStubIssue1', 'UnhiddenStubIssue2']); + assert.deepEqual(unhiddenIssues, ['UnhiddenStubIssue1', 'UnhiddenStubIssue2']); }); it('unhides all issues correctly', () => { @@ -311,7 +311,7 @@ describeWithMockConnection('IssuesManager', () => { } }); issuesManager.unhideAllIssues(); - assert.deepStrictEqual( + assert.deepEqual( unhiddenIssues, ['HiddenStubIssue1', 'HiddenStubIssue2', 'UnhiddenStubIssue1', 'UnhiddenStubIssue2']); }); diff --git a/front_end/models/issues_manager/PropertyRuleIssue.test.ts b/front_end/models/issues_manager/PropertyRuleIssue.test.ts index edb494f19f..049d637db9 100644 --- a/front_end/models/issues_manager/PropertyRuleIssue.test.ts +++ b/front_end/models/issues_manager/PropertyRuleIssue.test.ts @@ -38,7 +38,7 @@ describeWithLocale('PropertyRuleIssue', () => { const propertyRuleIssue = propertyRuleIssues[0]; assert.strictEqual(propertyRuleIssue.getCategory(), IssuesManager.Issue.IssueCategory.OTHER); - assert.deepStrictEqual(propertyRuleIssue.sources(), [issueDetails.sourceCodeLocation]); + assert.deepEqual(propertyRuleIssue.sources(), [issueDetails.sourceCodeLocation]); assert.strictEqual(propertyRuleIssue.getKind(), IssuesManager.Issue.IssueKind.PAGE_ERROR); assert.isNotNull(propertyRuleIssue.getDescription()); assert.strictEqual(propertyRuleIssue.getPropertyName(), 'initial-value'); diff --git a/front_end/models/issues_manager/RelatedIssue.test.ts b/front_end/models/issues_manager/RelatedIssue.test.ts index 152d8e129d..52d4b39d75 100644 --- a/front_end/models/issues_manager/RelatedIssue.test.ts +++ b/front_end/models/issues_manager/RelatedIssue.test.ts @@ -36,8 +36,8 @@ describe('issuesAssociatedWith', () => { const request2 = SDK.NetworkRequest.NetworkRequest.create( requestId2, Platform.DevToolsPath.EmptyUrlString, Platform.DevToolsPath.EmptyUrlString, null, null, null); - assert.deepStrictEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, request1), issues); - assert.deepStrictEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, request2), [issue1]); + assert.deepEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, request1), issues); + assert.deepEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, request2), [issue1]); }); function createTestCookie(name: string): SDK.Cookie.Cookie { @@ -57,8 +57,8 @@ describe('issuesAssociatedWith', () => { const cookie2 = createTestCookie('c2'); const cookie3 = createTestCookie('c3'); - assert.deepStrictEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, cookie1), [issue1, issue3]); - assert.deepStrictEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, cookie2), [issue1]); - assert.deepStrictEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, cookie3), [issue2]); + assert.deepEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, cookie1), [issue1, issue3]); + assert.deepEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, cookie2), [issue1]); + assert.deepEqual(IssuesManager.RelatedIssue.issuesAssociatedWith(issues, cookie3), [issue2]); }); }); diff --git a/front_end/models/issues_manager/SharedDictionaryIssue.test.ts b/front_end/models/issues_manager/SharedDictionaryIssue.test.ts index 96e8e16700..da3251eb1b 100644 --- a/front_end/models/issues_manager/SharedDictionaryIssue.test.ts +++ b/front_end/models/issues_manager/SharedDictionaryIssue.test.ts @@ -60,7 +60,7 @@ describeWithLocale('SharedDictionaryIssue', () => { const sharedDictionaryIssue = sharedDictionaryIssues[0]; assert.strictEqual(sharedDictionaryIssue.getCategory(), IssuesManager.Issue.IssueCategory.OTHER); - assert.deepStrictEqual(sharedDictionaryIssue.details(), issueDetails); + assert.deepEqual(sharedDictionaryIssue.details(), issueDetails); assert.strictEqual(sharedDictionaryIssue.getKind(), IssuesManager.Issue.IssueKind.PAGE_ERROR); assert.isNotNull(sharedDictionaryIssue.getDescription()); } diff --git a/front_end/models/issues_manager/StylesheetLoadingIssue.test.ts b/front_end/models/issues_manager/StylesheetLoadingIssue.test.ts index 6b10636050..b9f1ba8d68 100644 --- a/front_end/models/issues_manager/StylesheetLoadingIssue.test.ts +++ b/front_end/models/issues_manager/StylesheetLoadingIssue.test.ts @@ -40,9 +40,9 @@ describeWithLocale('StylesheetLoadingIssue', () => { const stylesheetIssue = stylesheetIssues[0]; assert.strictEqual(stylesheetIssue.getCategory(), IssuesManager.Issue.IssueCategory.OTHER); - assert.deepStrictEqual(stylesheetIssue.sources(), [issueDetails.sourceCodeLocation]); + assert.deepEqual(stylesheetIssue.sources(), [issueDetails.sourceCodeLocation]); const {url, requestId} = issueDetails.failedRequestInfo; - assert.deepStrictEqual(stylesheetIssue.requests(), [{url, requestId}]); + assert.deepEqual(stylesheetIssue.requests(), [{url, requestId}]); assert.strictEqual(stylesheetIssue.getKind(), IssuesManager.Issue.IssueKind.PAGE_ERROR); assert.isNotNull(stylesheetIssue.getDescription()); }); @@ -63,7 +63,7 @@ describeWithLocale('StylesheetLoadingIssue', () => { const stylesheetIssue = stylesheetIssues[0]; assert.strictEqual(stylesheetIssue.getCategory(), IssuesManager.Issue.IssueCategory.OTHER); - assert.deepStrictEqual(stylesheetIssue.sources(), [issueDetails.sourceCodeLocation]); + assert.deepEqual(stylesheetIssue.sources(), [issueDetails.sourceCodeLocation]); assert.strictEqual(stylesheetIssue.getKind(), IssuesManager.Issue.IssueKind.PAGE_ERROR); assert.isNotNull(stylesheetIssue.getDescription()); }); @@ -124,15 +124,15 @@ describeWithLocale('StylesheetLoadingIssue', () => { const aggregatedIssues = Array.from(aggregator.aggregatedIssues()); assert.lengthOf(aggregatedIssues, 2); - assert.deepStrictEqual( + assert.deepEqual( Array.from(aggregatedIssues[0].sources()), [issueDetails[0].sourceCodeLocation, issueDetails[1].sourceCodeLocation]); - assert.deepStrictEqual( + assert.deepEqual( Array.from(aggregatedIssues[1].sources()), [issueDetails[2].sourceCodeLocation, issueDetails[3].sourceCodeLocation]); - assert.deepStrictEqual(Array.from(aggregatedIssues[0].requests()), []); + assert.deepEqual(Array.from(aggregatedIssues[0].requests()), []); const {url, requestId} = issueDetails[3].failedRequestInfo as Protocol.Audits.FailedRequestInfo; assert.exists(requestId); - assert.deepStrictEqual(Array.from(aggregatedIssues[1].requests()), [{url, requestId}]); + assert.deepEqual(Array.from(aggregatedIssues[1].requests()), [{url, requestId}]); }); }); diff --git a/front_end/models/persistence/NetworkPersistenceManager.test.ts b/front_end/models/persistence/NetworkPersistenceManager.test.ts index b9e39ff554..7ee597960f 100644 --- a/front_end/models/persistence/NetworkPersistenceManager.test.ts +++ b/front_end/models/persistence/NetworkPersistenceManager.test.ts @@ -109,7 +109,7 @@ describeWithMockConnection('NetworkPersistenceManager', () => { requestStage: Protocol.Fetch.RequestStage.Response, }, ]; - assert.deepStrictEqual(patterns, expected); + assert.deepEqual(patterns, expected); }); it('recognizes forbidden network URLs', () => { @@ -690,7 +690,7 @@ describeWithMockConnection('NetworkPersistenceManager', () => { workspace.dispatchEventToListeners(Workspace.Workspace.Events.ProjectRemoved, project); setTimeout(() => { - assert.deepStrictEqual( + assert.deepEqual( eventURLs, ['file:///path/to/overrides/.headers', 'file:///path/to/overrides/www.example.com/.headers']); assert.isFalse(networkPersistenceManager.hasMatchingNetworkUISourceCodeForHeaderOverridesFile({ url: () => 'file:///path/to/overrides/www.example.com/.headers', diff --git a/front_end/models/trace/Processor.test.ts b/front_end/models/trace/Processor.test.ts index b230ce931d..5009c6b81a 100644 --- a/front_end/models/trace/Processor.test.ts +++ b/front_end/models/trace/Processor.test.ts @@ -254,7 +254,7 @@ describeWithEnvironment('TraceProcessor', function() { } assert.strictEqual(processor.insights.size, 1); - assert.deepStrictEqual([...processor.insights.keys()], [Trace.Types.Events.NO_NAVIGATION]); + assert.deepEqual([...processor.insights.keys()], [Trace.Types.Events.NO_NAVIGATION]); }); it('captures errors thrown by insights', async function() { @@ -294,7 +294,7 @@ describeWithEnvironment('TraceProcessor', function() { throw new Error('No insights'); } - assert.deepStrictEqual([...processor.insights.keys()], [ + assert.deepEqual([...processor.insights.keys()], [ Trace.Types.Events.NO_NAVIGATION, '0BCFC23BC7D7BEDC9F93E912DCCEC1DA', ]); @@ -313,7 +313,7 @@ describeWithEnvironment('TraceProcessor', function() { throw new Error('No insights'); } - assert.deepStrictEqual([...processor.insights.keys()], [ + assert.deepEqual([...processor.insights.keys()], [ Trace.Types.Events.NO_NAVIGATION, '0BCFC23BC7D7BEDC9F93E912DCCEC1DA', ]); @@ -339,7 +339,7 @@ describeWithEnvironment('TraceProcessor', function() { throw new Error('No insights'); } - assert.deepStrictEqual([...processor.insights.keys()], [ + assert.deepEqual([...processor.insights.keys()], [ Trace.Types.Events.NO_NAVIGATION, '83ACBFD389F1F66EF79CEDB4076EB44A', '70BCD304FD2C098BA2513488AB0FF3F2', @@ -395,7 +395,7 @@ describeWithEnvironment('TraceProcessor', function() { }; const orderWithoutMetadata = await getInsightOrder(false); - assert.deepStrictEqual(orderWithoutMetadata, [ + assert.deepEqual(orderWithoutMetadata, [ 'CLSCulprits', 'Viewport', 'InteractionToNextPaint', @@ -412,7 +412,7 @@ describeWithEnvironment('TraceProcessor', function() { const orderWithMetadata = await getInsightOrder(true); // Viewport is first, before CLSCulprits, since the field data produces a higher weight for INP than for CLS. - assert.deepStrictEqual(orderWithMetadata, [ + assert.deepEqual(orderWithMetadata, [ 'Viewport', 'CLSCulprits', 'InteractionToNextPaint', diff --git a/front_end/models/trace/handlers/MetaHandler.test.ts b/front_end/models/trace/handlers/MetaHandler.test.ts index 1dfe354f01..13f8023496 100644 --- a/front_end/models/trace/handlers/MetaHandler.test.ts +++ b/front_end/models/trace/handlers/MetaHandler.test.ts @@ -104,7 +104,7 @@ describe('MetaHandler', function() { await Trace.Handlers.ModelHandlers.Meta.finalize(); const data = Trace.Handlers.ModelHandlers.Meta.data(); assert.strictEqual(data.topLevelRendererIds.size, 1); - assert.deepStrictEqual([...data.topLevelRendererIds], [Trace.Types.Events.ProcessID(8051)]); + assert.deepEqual([...data.topLevelRendererIds], [Trace.Types.Events.ProcessID(8051)]); }); }); @@ -231,16 +231,16 @@ describe('MetaHandler', function() { await Trace.Handlers.ModelHandlers.Meta.finalize(); const data = Trace.Handlers.ModelHandlers.Meta.data(); - assert.deepStrictEqual([...data.topLevelRendererIds], [3601132]); + assert.deepEqual([...data.topLevelRendererIds], [3601132]); const rendererProcesses = data.rendererProcessesByFrame.get(data.mainFrameId); if (!rendererProcesses) { assert.fail('No renderer processes found'); return; } - assert.deepStrictEqual([...rendererProcesses?.keys()], [3601132]); + assert.deepEqual([...rendererProcesses?.keys()], [3601132]); const windowMinTime = 1143381875846; - assert.deepStrictEqual( + assert.deepEqual( [...rendererProcesses?.values()], [[{ frame: { frame: '1D148CB660D1F96ED70D78DC6A53267B', @@ -268,7 +268,7 @@ describe('MetaHandler', function() { await Trace.Handlers.ModelHandlers.Meta.finalize(); const data = Trace.Handlers.ModelHandlers.Meta.data(); - assert.deepStrictEqual([...data.topLevelRendererIds], [78450, 78473, 79194]); + assert.deepEqual([...data.topLevelRendererIds], [78450, 78473, 79194]); const rendererProcesses = data.rendererProcessesByFrame.get(data.mainFrameId); if (!rendererProcesses) { @@ -277,8 +277,8 @@ describe('MetaHandler', function() { } const windowMinTime = 3550807444741; - assert.deepStrictEqual([...rendererProcesses?.keys()], [78450, 78473, 79194]); - assert.deepStrictEqual([...rendererProcesses?.values()], [ + assert.deepEqual([...rendererProcesses?.keys()], [78450, 78473, 79194]); + assert.deepEqual([...rendererProcesses?.values()], [ [{ frame: { frame: 'E70A9327100EBD78F1C03582BBBE8E5F', @@ -324,7 +324,7 @@ describe('MetaHandler', function() { await Trace.Handlers.ModelHandlers.Meta.finalize(); const data = Trace.Handlers.ModelHandlers.Meta.data(); - assert.deepStrictEqual([...data.topLevelRendererIds], [2080]); + assert.deepEqual([...data.topLevelRendererIds], [2080]); const rendererProcesses = data.rendererProcessesByFrame.get(data.mainFrameId); if (!rendererProcesses) { @@ -332,8 +332,8 @@ describe('MetaHandler', function() { return; } - assert.deepStrictEqual([...rendererProcesses?.keys()], [2080]); - assert.deepStrictEqual([...rendererProcesses?.values()], [ + assert.deepEqual([...rendererProcesses?.keys()], [2080]); + assert.deepEqual([...rendererProcesses?.values()], [ [ { frame: { diff --git a/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts b/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts index bb4e6ec05a..4f2d306416 100644 --- a/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts +++ b/front_end/models/trace/handlers/NetworkRequestsHandler.test.ts @@ -224,7 +224,7 @@ describe('NetworkRequestsHandler', function() { const {byTime} = Trace.Handlers.ModelHandlers.NetworkRequests.data(); assert.strictEqual(byTime.length, 2, 'Incorrect number of requests'); assert.strictEqual(byTime[0].args.data.redirects.length, 0, 'Incorrect number of redirects (request 0)'); - assert.deepStrictEqual( + assert.deepEqual( byTime[1].args.data.redirects, [ { @@ -257,7 +257,7 @@ describe('NetworkRequestsHandler', function() { const {byTime} = Trace.Handlers.ModelHandlers.NetworkRequests.data(); assert.strictEqual(byTime.length, 2, 'Incorrect number of requests'); assert.strictEqual(byTime[0].args.data.redirects.length, 0, 'Incorrect number of redirects (request 0)'); - assert.deepStrictEqual( + assert.deepEqual( byTime[1].args.data.redirects, [ { diff --git a/front_end/models/trace/handlers/RendererHandler.test.ts b/front_end/models/trace/handlers/RendererHandler.test.ts index d5e18ae3eb..8cbf3a438d 100644 --- a/front_end/models/trace/handlers/RendererHandler.test.ts +++ b/front_end/models/trace/handlers/RendererHandler.test.ts @@ -34,7 +34,7 @@ describeWithEnvironment('RendererHandler', function() { assert.strictEqual(renderers.processes.size, 4); const pids = [...renderers.processes].map(([pid]) => pid); - assert.deepStrictEqual( + assert.deepEqual( pids, [ MAIN_FRAME_PID, // Main frame process: localhost:5000 @@ -60,7 +60,7 @@ describeWithEnvironment('RendererHandler', function() { // Assert on whether it has correctly detected a given process to be on the // main frame or in a subframe. const isOnMainFrame = [...renderers.processes].map(([, process]) => process.isOnMainFrame); - assert.deepStrictEqual( + assert.deepEqual( isOnMainFrame, [ true, // Main frame process: localhost:5000 diff --git a/front_end/models/trace/handlers/ScreenshotsHandler.test.ts b/front_end/models/trace/handlers/ScreenshotsHandler.test.ts index 3a0902c0cb..1814bc7275 100644 --- a/front_end/models/trace/handlers/ScreenshotsHandler.test.ts +++ b/front_end/models/trace/handlers/ScreenshotsHandler.test.ts @@ -87,7 +87,7 @@ describe('ScreenshotsHandler', function() { const msDifferences = getMsDifferences(syntheticScreenshots, originalScreenshotEvents); // These values indicate all the screenshots true timings are a tad more to the left. - assert.deepStrictEqual(msDifferences, [ + assert.deepEqual(msDifferences, [ -13.079, -16.381, -12.503, -5.405, -14.108, -14.661, -11.944, -14.322, -3.532, -15.821, 0.254, -32.22, -15.156, -13.219, -14.464, -16.135, -16.501, -33.165, -15.71, -32.39, -32.445, -30.512, ]); @@ -113,7 +113,7 @@ describe('ScreenshotsHandler', function() { const msDifferences = getMsDifferences(syntheticScreenshots, originalScreenshotEvents); // No adjustment made. - assert.deepStrictEqual(msDifferences, [ + assert.deepEqual(msDifferences, [ 0, 0, 0, diff --git a/front_end/models/trace/helpers/SamplesIntegrator.test.ts b/front_end/models/trace/helpers/SamplesIntegrator.test.ts index 22c8f04bb8..5c112ac1fd 100644 --- a/front_end/models/trace/helpers/SamplesIntegrator.test.ts +++ b/front_end/models/trace/helpers/SamplesIntegrator.test.ts @@ -84,10 +84,10 @@ describeWithEnvironment('SamplesIntegrator', function() { assert.strictEqual(jsSampleEvents[2].dur, 0); assert.strictEqual(jsSampleEvents[3].dur, 0); - assert.deepStrictEqual(jsSampleEvents[0].args.data.stackTrace.map(f => f.functionName), ['a']); - assert.deepStrictEqual(jsSampleEvents[1].args.data.stackTrace.map(f => f.functionName), ['a']); - assert.deepStrictEqual(jsSampleEvents[2].args.data.stackTrace.map(f => f.functionName), ['a', 'b']); - assert.deepStrictEqual(jsSampleEvents[3].args.data.stackTrace.map(f => f.functionName), ['a', 'b']); + assert.deepEqual(jsSampleEvents[0].args.data.stackTrace.map(f => f.functionName), ['a']); + assert.deepEqual(jsSampleEvents[1].args.data.stackTrace.map(f => f.functionName), ['a']); + assert.deepEqual(jsSampleEvents[2].args.data.stackTrace.map(f => f.functionName), ['a', 'b']); + assert.deepEqual(jsSampleEvents[3].args.data.stackTrace.map(f => f.functionName), ['a', 'b']); }); }); diff --git a/front_end/models/trace/helpers/TreeHelpers.test.ts b/front_end/models/trace/helpers/TreeHelpers.test.ts index c972ccc43f..60d5b23220 100644 --- a/front_end/models/trace/helpers/TreeHelpers.test.ts +++ b/front_end/models/trace/helpers/TreeHelpers.test.ts @@ -488,7 +488,7 @@ describe('TreeHelpers', () => { assert.exists(v8RunNode); // First check the serialization as a while. - assert.deepStrictEqual(JSON.parse(JSON.stringify(aiNodeTree)), { + assert.deepEqual(JSON.parse(JSON.stringify(aiNodeTree)), { name: 'EvaluateScript', dur: 0.5, self: 0, diff --git a/front_end/models/trace/insights/CLSCulprits.test.ts b/front_end/models/trace/insights/CLSCulprits.test.ts index 0495e0dd09..03a82d47e7 100644 --- a/front_end/models/trace/insights/CLSCulprits.test.ts +++ b/front_end/models/trace/insights/CLSCulprits.test.ts @@ -44,7 +44,7 @@ describeWithEnvironment('CLSCulprits', function() { animation: top, }, ]; - assert.deepStrictEqual(animationFailures, expected); + assert.deepEqual(animationFailures, expected); }); // Flaky test. it.skip('[crbug.com/370382177]: gets the correct non composited animations for shift', async function() { @@ -72,7 +72,7 @@ describeWithEnvironment('CLSCulprits', function() { animation: simpleAnimation, }, ]; - assert.deepStrictEqual(shiftAnimations, expectedWithShift); + assert.deepEqual(shiftAnimations, expectedWithShift); const expectedAll: Models.CLSCulprits.NoncompositedAnimationFailure[] = [ { @@ -89,7 +89,7 @@ describeWithEnvironment('CLSCulprits', function() { }, ]; // animationFailures should include both root causes failures, and failures without associated shifts. - assert.deepStrictEqual(animationFailures, expectedAll); + assert.deepEqual(animationFailures, expectedAll); }); it('returns no insights when there are no non-composited animations', async function() { diff --git a/front_end/models/trace/insights/Common.test.ts b/front_end/models/trace/insights/Common.test.ts index 1f5cbf3828..835ca264f3 100644 --- a/front_end/models/trace/insights/Common.test.ts +++ b/front_end/models/trace/insights/Common.test.ts @@ -35,18 +35,18 @@ describeWithEnvironment('Common', function() { // No field data defaults to even split of weights. metadata.cruxFieldData = undefined; let weights = calculateMetricWeightsForSorting(insightSet, metadata); - assert.deepStrictEqual(weights, {lcp: 1 / 3, inp: 1 / 3, cls: 1 / 3}); + assert.deepEqual(weights, {lcp: 1 / 3, inp: 1 / 3, cls: 1 / 3}); metadata.cruxFieldData = []; weights = calculateMetricWeightsForSorting(insightSet, metadata); - assert.deepStrictEqual(weights, {lcp: 1 / 3, inp: 1 / 3, cls: 1 / 3}); + assert.deepEqual(weights, {lcp: 1 / 3, inp: 1 / 3, cls: 1 / 3}); }); it('returns weights based on field data', async () => { const {insightSet, metadata} = await process(this, 'image-delivery.json.gz'); const weights = calculateMetricWeightsForSorting(insightSet, metadata); - assert.deepStrictEqual(weights, {lcp: 0.07778127820223579, inp: 0.5504200439526509, cls: 0.37179867784511333}); + assert.deepEqual(weights, {lcp: 0.07778127820223579, inp: 0.5504200439526509, cls: 0.37179867784511333}); }); }); }); diff --git a/front_end/models/trace/insights/FontDisplay.test.ts b/front_end/models/trace/insights/FontDisplay.test.ts index 3b872ab678..e11166c4f8 100644 --- a/front_end/models/trace/insights/FontDisplay.test.ts +++ b/front_end/models/trace/insights/FontDisplay.test.ts @@ -21,7 +21,7 @@ describeWithEnvironment('FontDisplay', function() { const insight = getInsightOrError('FontDisplay', insights, getFirstOrError(data.Meta.navigationsByNavigationId.values())); - assert.deepStrictEqual(insight.fonts.map(f => ({...f, request: f.request.args.data.url})), [ + assert.deepEqual(insight.fonts.map(f => ({...f, request: f.request.args.data.url})), [ { request: 'https://fonts.gstatic.com/s/ptsans/v17/jizaRExUiTo99u79D0KExcOPIDU.woff2', display: 'auto', diff --git a/front_end/models/trace/insights/ImageDelivery.test.ts b/front_end/models/trace/insights/ImageDelivery.test.ts index a77c35379d..d8b82e7085 100644 --- a/front_end/models/trace/insights/ImageDelivery.test.ts +++ b/front_end/models/trace/insights/ImageDelivery.test.ts @@ -16,7 +16,7 @@ describeWithEnvironment('ImageDelivery', function() { const {data, insights} = await processTrace(this, 'image-delivery.json.gz'); const imageRequests = data.NetworkRequests.byTime.filter(r => r.args.data.resourceType === 'Image'); - assert.deepStrictEqual(imageRequests.map(r => r.args.data.url), [ + assert.deepEqual(imageRequests.map(r => r.args.data.url), [ 'https://images.ctfassets.net/u275ja1nivmq/6T6z40ay5GFCUtwV7DONgh/0e23606ed1692d9721ab0f39a8d8a99e/yeti_cover.jpg', 'https://raw.githubusercontent.com/GoogleChrome/lighthouse/refs/heads/main/cli/test/fixtures/dobetterweb/lighthouse-rotating.gif', 'https://images-wixmp-ed30a86b8c4ca887773594c2.wixmp.com/f/5d52a2ab-7be3-4931-9e82-8728d1f55620/d51jfzi-b0efc925-7704-44bb-a3b8-8d98545af693.gif?token=eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ1cm46YXBwOjdlMGQxODg5ODIyNjQzNzNhNWYwZDQxNWVhMGQyNmUwIiwiaXNzIjoidXJuOmFwcDo3ZTBkMTg4OTgyMjY0MzczYTVmMGQ0MTVlYTBkMjZlMCIsIm9iaiI6W1t7InBhdGgiOiJcL2ZcLzVkNTJhMmFiLTdiZTMtNDkzMS05ZTgyLTg3MjhkMWY1NTYyMFwvZDUxamZ6aS1iMGVmYzkyNS03NzA0LTQ0YmItYTNiOC04ZDk4NTQ1YWY2OTMuZ2lmIn1dXSwiYXVkIjpbInVybjpzZXJ2aWNlOmZpbGUuZG93bmxvYWQiXX0.T898HUlAbGFPboxRE43H5JujnDGl0zd_T128PnGLlpg', @@ -31,7 +31,7 @@ describeWithEnvironment('ImageDelivery', function() { const insight = getInsightOrError('ImageDelivery', insights, getFirstOrError(data.Meta.navigationsByNavigationId.values())); assert.strictEqual(insight.totalByteSavings, 2007125); - assert.deepStrictEqual( + assert.deepEqual( insight.optimizableImages.map( o => ({url: o.request.args.data.url, optimizations: o.optimizations, byteSavings: o.byteSavings})), [ diff --git a/front_end/models/trace/insights/RenderBlocking.test.ts b/front_end/models/trace/insights/RenderBlocking.test.ts index 4997db9125..2a445bcc8c 100644 --- a/front_end/models/trace/insights/RenderBlocking.test.ts +++ b/front_end/models/trace/insights/RenderBlocking.test.ts @@ -9,8 +9,7 @@ import * as Trace from '../../trace/trace.js'; describeWithEnvironment('RenderBlocking', function() { it('finds render blocking requests', async () => { const {data, insights} = await processTrace(this, 'load-simple.json.gz'); - assert.deepStrictEqual( - [...insights.keys()], [Trace.Types.Events.NO_NAVIGATION, '0BCFC23BC7D7BEDC9F93E912DCCEC1DA']); + assert.deepEqual([...insights.keys()], [Trace.Types.Events.NO_NAVIGATION, '0BCFC23BC7D7BEDC9F93E912DCCEC1DA']); const insight = getInsightOrError('RenderBlocking', insights, data.Meta.navigationsByNavigationId.values().next().value); @@ -34,7 +33,7 @@ describeWithEnvironment('RenderBlocking', function() { it('considers only the navigation specified by the context', async () => { const {data, insights} = await processTrace(this, 'multiple-navigations-render-blocking.json.gz'); - assert.deepStrictEqual( + assert.deepEqual( [...insights.keys()], [Trace.Types.Events.NO_NAVIGATION, '8671F33ECE0C8DBAEFBC2F9A2D1D6107', '1AE2016BBCC48AA090FDAE2CBBA01900']); const navigations = Array.from(data.Meta.navigationsByNavigationId.values()); @@ -57,9 +56,9 @@ describeWithEnvironment('RenderBlocking', function() { const insightOne = getInsightOrError('RenderBlocking', insights); const insightTwo = getInsightOrError('RenderBlocking', insights, navigations[0]); const insightThree = getInsightOrError('RenderBlocking', insights, navigations[1]); - assert.deepStrictEqual(insightOne.renderBlockingRequests.map(r => r.args.data.requestId), []); - assert.deepStrictEqual(insightTwo.renderBlockingRequests.map(r => r.args.data.requestId), ['99116.2']); - assert.deepStrictEqual(insightThree.renderBlockingRequests.map(r => r.args.data.requestId), ['99116.5']); + assert.deepEqual(insightOne.renderBlockingRequests.map(r => r.args.data.requestId), []); + assert.deepEqual(insightTwo.renderBlockingRequests.map(r => r.args.data.requestId), ['99116.2']); + assert.deepEqual(insightThree.renderBlockingRequests.map(r => r.args.data.requestId), ['99116.5']); }); it('considers only the frame specified by the context', async () => { @@ -90,7 +89,7 @@ describeWithEnvironment('RenderBlocking', function() { const insight = getInsightOrError('RenderBlocking', insights, data.Meta.navigationsByNavigationId.values().next().value); - assert.deepStrictEqual(insight.renderBlockingRequests.map(r => r.args.data.url), [ + assert.deepEqual(insight.renderBlockingRequests.map(r => r.args.data.url), [ 'http://localhost:8080/render-blocking/style.css', 'http://localhost:8080/render-blocking/script.js?beforeImage', ]); @@ -105,7 +104,7 @@ describeWithEnvironment('RenderBlocking', function() { const insight = getInsightOrError('RenderBlocking', insights, data.Meta.navigationsByNavigationId.values().next().value); - assert.deepStrictEqual(insight.metricSavings, { + assert.deepEqual(insight.metricSavings, { FCP: 0, LCP: 0, } as Trace.Insights.Types.MetricSavings); @@ -115,7 +114,7 @@ describeWithEnvironment('RenderBlocking', function() { const url = insight.renderBlockingRequests.find(r => r.args.data.requestId === requestId)?.args.data.url; return [url, wastedMs]; }); - assert.deepStrictEqual(urlToWastedMs, []); + assert.deepEqual(urlToWastedMs, []); }); it('estimates savings with Lantern (text LCP)', async () => { @@ -124,7 +123,7 @@ describeWithEnvironment('RenderBlocking', function() { const insight = getInsightOrError('RenderBlocking', insights, data.Meta.navigationsByNavigationId.values().next().value); - assert.deepStrictEqual(insight.metricSavings, { + assert.deepEqual(insight.metricSavings, { FCP: 0, LCP: 0, } as Trace.Insights.Types.MetricSavings); @@ -133,6 +132,6 @@ describeWithEnvironment('RenderBlocking', function() { const url = insight.renderBlockingRequests.find(r => r.args.data.requestId === requestId)?.args.data.url; return [url, wastedMs]; }); - assert.deepStrictEqual(urlToWastedMs, []); + assert.deepEqual(urlToWastedMs, []); }); }); diff --git a/front_end/models/trace/lantern/core/NetworkAnalyzer.test.ts b/front_end/models/trace/lantern/core/NetworkAnalyzer.test.ts index d9ceb093a8..dc4cb4fa9b 100644 --- a/front_end/models/trace/lantern/core/NetworkAnalyzer.test.ts +++ b/front_end/models/trace/lantern/core/NetworkAnalyzer.test.ts @@ -72,7 +72,7 @@ describe('NetworkAnalyzer', () => { const result = NetworkAnalyzer.estimateIfConnectionWasReused(records); const expected = new Map([[1, false], [2, true], [3, false], [4, false], [5, true]]); - assert.deepStrictEqual(result, expected); + assert.deepEqual(result, expected); }); it('should estimate values when not trustworthy (duplicate IDs)', () => { @@ -85,7 +85,7 @@ describe('NetworkAnalyzer', () => { const result = NetworkAnalyzer.estimateIfConnectionWasReused(records); const expected = new Map([[1, false], [2, false], [3, true], [4, true]]); - assert.deepStrictEqual(result, expected); + assert.deepEqual(result, expected); }); it('should estimate values when not trustworthy (connectionReused nonsense)', () => { @@ -122,7 +122,7 @@ describe('NetworkAnalyzer', () => { const result = NetworkAnalyzer.estimateIfConnectionWasReused(records); const expected = new Map([[1, false], [2, false], [3, true], [4, true]]); - assert.deepStrictEqual(result, expected); + assert.deepEqual(result, expected); }); it('should estimate with earliest allowed reuse', () => { @@ -135,7 +135,7 @@ describe('NetworkAnalyzer', () => { const result = NetworkAnalyzer.estimateIfConnectionWasReused(records); const expected = new Map([[1, false], [2, false], [3, true], [4, true]]); - assert.deepStrictEqual(result, expected); + assert.deepEqual(result, expected); }); it('should work on a real trace', async () => { @@ -153,7 +153,7 @@ describe('NetworkAnalyzer', () => { const request = createRecord({networkRequestTime: 0, networkEndTime: 1, timing}); const result = NetworkAnalyzer.estimateRTTByOrigin([request]); const expected = {min: 99, max: 99, avg: 99, median: 99}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should infer only one estimate if tcp and ssl start times are equal', () => { @@ -161,7 +161,7 @@ describe('NetworkAnalyzer', () => { const request = createRecord({networkRequestTime: 0, networkEndTime: 1, timing}); const result = NetworkAnalyzer.estimateRTTByOrigin([request]); const expected = {min: 99, max: 99, avg: 99, median: 99}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should infer from tcp and ssl timing when available', () => { @@ -169,7 +169,7 @@ describe('NetworkAnalyzer', () => { const request = createRecord({networkRequestTime: 0, networkEndTime: 1, timing}); const result = NetworkAnalyzer.estimateRTTByOrigin([request]); const expected = {min: 49, max: 50, avg: 49.5, median: 49.5}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should infer from connection timing when available for h3 (one estimate)', () => { @@ -177,7 +177,7 @@ describe('NetworkAnalyzer', () => { const request = createRecord({networkRequestTime: 0, networkEndTime: 1, timing, protocol: 'h3'}); const result = NetworkAnalyzer.estimateRTTByOrigin([request]); const expected = {min: 99, max: 99, avg: 99, median: 99}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should infer from sendStart when available', () => { @@ -188,7 +188,7 @@ describe('NetworkAnalyzer', () => { const request = createRecord({networkRequestTime: 0, networkEndTime: 1, timing}); const result = NetworkAnalyzer.estimateRTTByOrigin([request], {coarseEstimateMultiplier: 1}); const expected = {min: 50, max: 50, avg: 50, median: 50}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should infer from download timing when available', () => { @@ -202,7 +202,7 @@ describe('NetworkAnalyzer', () => { useHeadersEndEstimates: false, }); const expected = {min: 1000, max: 1000, avg: 1000, median: 1000}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should infer from TTFB when available', () => { @@ -217,7 +217,7 @@ describe('NetworkAnalyzer', () => { // server response time. // 600 ms / 4 = 150ms const expected = {min: 150, max: 150, avg: 150, median: 150}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should use coarse estimates on a per-origin basis', () => { @@ -226,8 +226,8 @@ describe('NetworkAnalyzer', () => { createRecord({url: 'https://example2.com', timing: {sendStart: 150}}), ]; const result = NetworkAnalyzer.estimateRTTByOrigin(records); - assert.deepStrictEqual(result.get('https://example.com'), {min: 99, max: 99, avg: 99, median: 99}); - assert.deepStrictEqual(result.get('https://example2.com'), {min: 15, max: 15, avg: 15, median: 15}); + assert.deepEqual(result.get('https://example.com'), {min: 99, max: 99, avg: 99, median: 99}); + assert.deepEqual(result.get('https://example2.com'), {min: 15, max: 15, avg: 15, median: 15}); }); it('should handle untrustworthy connection information', () => { @@ -244,7 +244,7 @@ describe('NetworkAnalyzer', () => { coarseEstimateMultiplier: 1, }); const expected = {min: 50, max: 50, avg: 50, median: 50}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should work on a real trace', async () => { @@ -276,7 +276,7 @@ describe('NetworkAnalyzer', () => { const rttByOrigin = new Map([[NetworkAnalyzer.summary, 0]]); const result = NetworkAnalyzer.estimateServerResponseTimeByOrigin([request], {rttByOrigin}); const expected = {min: 100, max: 100, avg: 100, median: 100}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should subtract out rtt', () => { @@ -285,7 +285,7 @@ describe('NetworkAnalyzer', () => { const rttByOrigin = new Map([[NetworkAnalyzer.summary, 50]]); const result = NetworkAnalyzer.estimateServerResponseTimeByOrigin([request], {rttByOrigin}); const expected = {min: 50, max: 50, avg: 50, median: 50}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should compute rtts when not provided', () => { @@ -293,7 +293,7 @@ describe('NetworkAnalyzer', () => { const request = createRecord({networkRequestTime: 0, networkEndTime: 1, timing}); const result = NetworkAnalyzer.estimateServerResponseTimeByOrigin([request]); const expected = {min: 50, max: 50, avg: 50, median: 50}; - assert.deepStrictEqual(result.get('https://example.com'), expected); + assert.deepEqual(result.get('https://example.com'), expected); }); it('should work on a real trace', async () => { @@ -423,7 +423,7 @@ describe('NetworkAnalyzer', () => { const result = NetworkAnalyzer.computeRTTAndServerResponseTime(requests); expect(result.rtt).to.be.closeTo(0.082, 0.001); - assert.deepStrictEqual([...result.additionalRttByOrigin.entries()], [ + assert.deepEqual([...result.additionalRttByOrigin.entries()], [ [ 'https://www.paulirish.com', 9.788999999999994, diff --git a/front_end/models/trace/lantern/graph/BaseNode.test.ts b/front_end/models/trace/lantern/graph/BaseNode.test.ts index 4f358035d5..b156d1b8b5 100644 --- a/front_end/models/trace/lantern/graph/BaseNode.test.ts +++ b/front_end/models/trace/lantern/graph/BaseNode.test.ts @@ -261,7 +261,7 @@ describe('BaseNode', () => { paths.push(traversalPath.map(node => node.id)); }); - assert.deepStrictEqual(paths, [ + assert.deepEqual(paths, [ ['A'], ['B', 'A'], ['C', 'A'], diff --git a/front_end/models/trace/lantern/metrics/FirstContentfulPaint.test.ts b/front_end/models/trace/lantern/metrics/FirstContentfulPaint.test.ts index 9d6228e638..59df3c5a86 100644 --- a/front_end/models/trace/lantern/metrics/FirstContentfulPaint.test.ts +++ b/front_end/models/trace/lantern/metrics/FirstContentfulPaint.test.ts @@ -18,7 +18,7 @@ describe('Metrics: Lantern FCP', () => { const data = await getComputationDataFromFixture({trace}); const result = FirstContentfulPaint.compute(data); - assert.deepStrictEqual( + assert.deepEqual( { timing: Math.round(result.timing), optimistic: Math.round(result.optimisticEstimate.timeInMs), diff --git a/front_end/models/trace/lantern/metrics/Interactive.test.ts b/front_end/models/trace/lantern/metrics/Interactive.test.ts index 658d8d5c22..d361b2816c 100644 --- a/front_end/models/trace/lantern/metrics/Interactive.test.ts +++ b/front_end/models/trace/lantern/metrics/Interactive.test.ts @@ -24,7 +24,7 @@ describe('Metrics: Lantern TTI', () => { }), }); - assert.deepStrictEqual( + assert.deepEqual( { timing: Math.round(result.timing), optimistic: Math.round(result.optimisticEstimate.timeInMs), @@ -51,7 +51,7 @@ describe('Metrics: Lantern TTI', () => { }), }); - assert.deepStrictEqual( + assert.deepEqual( { timing: Math.round(result.timing), optimistic: Math.round(result.optimisticEstimate.timeInMs), diff --git a/front_end/models/trace/lantern/metrics/LargestContentfulPaint.test.ts b/front_end/models/trace/lantern/metrics/LargestContentfulPaint.test.ts index 35eb5b03e0..5a58d6bf75 100644 --- a/front_end/models/trace/lantern/metrics/LargestContentfulPaint.test.ts +++ b/front_end/models/trace/lantern/metrics/LargestContentfulPaint.test.ts @@ -20,7 +20,7 @@ describe('Metrics: Lantern LCP', () => { fcpResult: FirstContentfulPaint.compute(data), }); - assert.deepStrictEqual( + assert.deepEqual( { timing: Math.round(result.timing), optimistic: Math.round(result.optimisticEstimate.timeInMs), diff --git a/front_end/models/trace/lantern/metrics/SpeedIndex.test.ts b/front_end/models/trace/lantern/metrics/SpeedIndex.test.ts index e11fbd6d4b..84831962ec 100644 --- a/front_end/models/trace/lantern/metrics/SpeedIndex.test.ts +++ b/front_end/models/trace/lantern/metrics/SpeedIndex.test.ts @@ -26,7 +26,7 @@ describe('Metrics: Lantern Speed Index', () => { observedSpeedIndex, }); - assert.deepStrictEqual( + assert.deepEqual( { timing: Math.round(result.timing), optimistic: Math.round(result.optimisticEstimate.timeInMs), @@ -53,7 +53,7 @@ describe('Metrics: Lantern Speed Index', () => { observedSpeedIndex, }); - assert.deepStrictEqual( + assert.deepEqual( { timing: Math.round(result.timing), optimistic: Math.round(result.optimisticEstimate.timeInMs), @@ -78,7 +78,7 @@ describe('Metrics: Lantern Speed Index', () => { it('should scale coefficients forward', async () => { const result = SpeedIndex.getScaledCoefficients(300); - assert.deepStrictEqual(result, { + assert.deepEqual(result, { intercept: 0, optimistic: 2.525, pessimistic: 0.275, diff --git a/front_end/models/trace/lantern/simulation/ConnectionPool.test.ts b/front_end/models/trace/lantern/simulation/ConnectionPool.test.ts index 498f3e5e60..e7ff0a5c92 100644 --- a/front_end/models/trace/lantern/simulation/ConnectionPool.test.ts +++ b/front_end/models/trace/lantern/simulation/ConnectionPool.test.ts @@ -100,7 +100,7 @@ describe('ConnectionPool', () => { assert.strictEqual(pool.acquireActiveConnectionFromRequest(requestB), connectionForB); } - assert.deepStrictEqual(pool.connectionsInUse(), [connectionForA, connectionForB]); + assert.deepEqual(pool.connectionsInUse(), [connectionForA, connectionForB]); }); it('should allocate at least 6 connections', () => { diff --git a/front_end/models/workspace/WorkspaceImpl.test.ts b/front_end/models/workspace/WorkspaceImpl.test.ts index 688875d766..a8f52b64ac 100644 --- a/front_end/models/workspace/WorkspaceImpl.test.ts +++ b/front_end/models/workspace/WorkspaceImpl.test.ts @@ -52,7 +52,7 @@ describe('WorkspaceImpl', () => { const result = sut.uiSourceCodesForProjectType(Workspace.Workspace.projectTypes.Debugger); - assert.deepStrictEqual(result, [uiSourceCodeStub]); + assert.deepEqual(result, [uiSourceCodeStub]); }); it('can remove a project', () => { @@ -62,7 +62,7 @@ describe('WorkspaceImpl', () => { sut.removeProject(projectStub); - assert.deepStrictEqual(sut.projects(), []); + assert.deepEqual(sut.projects(), []); }); it('can retrieve a project by ID', () => { @@ -74,7 +74,7 @@ describe('WorkspaceImpl', () => { const result = sut.project(exampleProjectID); - assert.deepStrictEqual(result, projectStub); + assert.deepEqual(result, projectStub); }); it('can retrieve all projects', () => { @@ -88,7 +88,7 @@ describe('WorkspaceImpl', () => { const result = sut.projects(); - assert.deepStrictEqual(result, [projectStub0, projectStub1]); + assert.deepEqual(result, [projectStub0, projectStub1]); }); it('can retrieve all projects for a certain type', () => { @@ -104,7 +104,7 @@ describe('WorkspaceImpl', () => { const result = sut.projectsForType(Workspace.Workspace.projectTypes.Debugger); - assert.deepStrictEqual(result, [projectStub0]); + assert.deepEqual(result, [projectStub0]); }); it('can return the UI source code from project type', async () => { @@ -116,7 +116,7 @@ describe('WorkspaceImpl', () => { const result = sut.uiSourceCodes(); - assert.deepStrictEqual(result, [uiSourceCodeStub]); + assert.deepEqual(result, [uiSourceCodeStub]); }); it('can check if there are tracking extensions', async () => { diff --git a/front_end/panels/ai_assistance/AiAssistancePanel.test.ts b/front_end/panels/ai_assistance/AiAssistancePanel.test.ts index 4702bb8bf4..d574a6129c 100644 --- a/front_end/panels/ai_assistance/AiAssistancePanel.test.ts +++ b/front_end/panels/ai_assistance/AiAssistancePanel.test.ts @@ -1054,7 +1054,7 @@ describeWithEnvironment('FreestylerPanel', () => { })); UI.Context.Context.instance().setFlavor(ElementsPanel.ElementsPanel.ElementsPanel, null); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); @@ -1076,7 +1076,7 @@ describeWithEnvironment('FreestylerPanel', () => { panel.markAsRoot(); panel.show(document.body); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); }); @@ -1126,7 +1126,7 @@ describeWithEnvironment('FreestylerPanel', () => { })); UI.Context.Context.instance().setFlavor(NetworkPanel.NetworkPanel.NetworkPanel, null); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); @@ -1149,7 +1149,7 @@ describeWithEnvironment('FreestylerPanel', () => { panel.markAsRoot(); panel.show(document.body); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); }); @@ -1199,7 +1199,7 @@ describeWithEnvironment('FreestylerPanel', () => { })); UI.Context.Context.instance().setFlavor(SourcesPanel.SourcesPanel.SourcesPanel, null); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); @@ -1222,7 +1222,7 @@ describeWithEnvironment('FreestylerPanel', () => { panel.markAsRoot(); panel.show(document.body); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); }); @@ -1274,7 +1274,7 @@ describeWithEnvironment('FreestylerPanel', () => { })); UI.Context.Context.instance().setFlavor(TimelinePanel.TimelinePanel.TimelinePanel, null); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); @@ -1297,7 +1297,7 @@ describeWithEnvironment('FreestylerPanel', () => { panel.markAsRoot(); panel.show(document.body); - assert.deepStrictEqual(mockView.lastCall.args[0].agentType, undefined); + assert.deepEqual(mockView.lastCall.args[0].agentType, undefined); stub.restore(); }); }); diff --git a/front_end/panels/ai_assistance/ChangeManager.test.ts b/front_end/panels/ai_assistance/ChangeManager.test.ts index 85368637cf..444d7f2904 100644 --- a/front_end/panels/ai_assistance/ChangeManager.test.ts +++ b/front_end/panels/ai_assistance/ChangeManager.test.ts @@ -48,7 +48,7 @@ describe('ChangeManager', () => { }, }); assert(cssModel.setStyleSheetText.calledOnce); - assert.deepStrictEqual(cssModel.setStyleSheetText.args, [ + assert.deepEqual(cssModel.setStyleSheetText.args, [ [styleSheetId, '.ai-style-change-1 {\n div& {\n color: blue;\n }\n}', true], ]); }); @@ -71,7 +71,7 @@ describe('ChangeManager', () => { }, }); assert(cssModel.setStyleSheetText.calledTwice); - assert.deepStrictEqual(cssModel.setStyleSheetText.args, [ + assert.deepEqual(cssModel.setStyleSheetText.args, [ [styleSheetId, '.ai-style-change-1 {\n div& {\n color: blue;\n }\n}', true], [styleSheetId, '.ai-style-change-1 {\n div& {\n color: green;\n }\n}', true], ]); @@ -95,7 +95,7 @@ describe('ChangeManager', () => { }, }); assert(cssModel.setStyleSheetText.calledTwice); - assert.deepStrictEqual(cssModel.setStyleSheetText.args, [ + assert.deepEqual(cssModel.setStyleSheetText.args, [ [styleSheetId, '.ai-style-change-1 {\n div& {\n color: blue;\n }\n}', true], [styleSheetId, '.ai-style-change-1 {\n div& {\n color: green;\n }\n}', true], ]); @@ -112,7 +112,7 @@ describe('ChangeManager', () => { }, }); assert(cssModel.setStyleSheetText.calledOnce); - assert.deepStrictEqual(cssModel.setStyleSheetText.args, [ + assert.deepEqual(cssModel.setStyleSheetText.args, [ [styleSheetId, '.ai-style-change-1 {\n div& {\n color: blue;\n }\n}', true], ]); await changeManager.clear(); @@ -124,7 +124,7 @@ describe('ChangeManager', () => { }, }); assert(cssModel.setStyleSheetText.calledTwice); - assert.deepStrictEqual(cssModel.setStyleSheetText.args, [ + assert.deepEqual(cssModel.setStyleSheetText.args, [ [styleSheetId, '.ai-style-change-1 {\n div& {\n color: blue;\n }\n}', true], // before clear(). [styleSheetId, '.ai-style-change-1 {\n body& {\n color: green;\n }\n}', true], ]); diff --git a/front_end/panels/ai_assistance/EvaluateAction.test.ts b/front_end/panels/ai_assistance/EvaluateAction.test.ts index 3f0339169b..5b97f85468 100644 --- a/front_end/panels/ai_assistance/EvaluateAction.test.ts +++ b/front_end/panels/ai_assistance/EvaluateAction.test.ts @@ -198,16 +198,15 @@ describe('FreestylerEvaluateAction', () => { }); it('should not trigger a side-effect for returning data', async () => { - assert.deepStrictEqual(await executeForTest('const data = {}', true), '{}'); + assert.deepEqual(await executeForTest('const data = {}', true), '{}'); }); it('should not trigger a side-effect on errors', async () => { - assert.deepStrictEqual(await executeForTest('throw new Error("test")', true), 'Error: test'); + assert.deepEqual(await executeForTest('throw new Error("test")', true), 'Error: test'); }); it('should not trigger a side-effect on syntax errors', async () => { - assert.deepStrictEqual( - await executeForTest('const data = {;', true), 'Error: SyntaxError: Unexpected token \';\''); + assert.deepEqual(await executeForTest('const data = {;', true), 'Error: SyntaxError: Unexpected token \';\''); }); }); }); diff --git a/front_end/panels/ai_assistance/agents/AiAgent.test.ts b/front_end/panels/ai_assistance/agents/AiAgent.test.ts index 96e534b06e..79d317163a 100644 --- a/front_end/panels/ai_assistance/agents/AiAgent.test.ts +++ b/front_end/panels/ai_assistance/agents/AiAgent.test.ts @@ -131,7 +131,7 @@ describeWithEnvironment('AiAgent', () => { serverSideLoggingEnabled: false, }); const request = agent.buildRequest({text: 'test input'}); - assert.deepStrictEqual(request.current_message?.parts[0], {text: 'test input'}); + assert.deepEqual(request.current_message?.parts[0], {text: 'test input'}); assert.strictEqual(request.historical_contexts, undefined); }); @@ -148,7 +148,7 @@ describeWithEnvironment('AiAgent', () => { aidaClient: {} as Host.AidaClient.AidaClient, }); const request = agent.buildRequest({text: 'test input'}); - assert.deepStrictEqual(request.current_message?.parts[0], {text: 'test input'}); + assert.deepEqual(request.current_message?.parts[0], {text: 'test input'}); assert.strictEqual(request.preamble, 'preamble'); assert.strictEqual(request.historical_contexts, undefined); }); @@ -190,8 +190,8 @@ describeWithEnvironment('AiAgent', () => { }, ]; const request = agent.buildRequest({text: 'test input'}); - assert.deepStrictEqual(request.current_message?.parts[0], {text: 'test input'}); - assert.deepStrictEqual(request.historical_contexts, [ + assert.deepEqual(request.current_message?.parts[0], {text: 'test input'}); + assert.deepEqual(request.historical_contexts, [ { parts: [{text: 'test'}], role: 1, @@ -238,8 +238,8 @@ describeWithEnvironment('AiAgent', () => { }, ]; const request = agent.buildRequest({text: 'test input'}); - assert.deepStrictEqual(request.current_message?.parts[0], {text: 'test input'}); - assert.deepStrictEqual(request.historical_contexts, undefined); + assert.deepEqual(request.current_message?.parts[0], {text: 'test input'}); + assert.deepEqual(request.historical_contexts, undefined); }); it('builds a request with aborted query in history before a real request', async () => { @@ -299,8 +299,8 @@ describeWithEnvironment('AiAgent', () => { }, ]; const request = agent.buildRequest({text: 'test input'}); - assert.deepStrictEqual(request.current_message?.parts[0], {text: 'test input'}); - assert.deepStrictEqual(request.historical_contexts, [ + assert.deepEqual(request.current_message?.parts[0], {text: 'test input'}); + assert.deepEqual(request.historical_contexts, [ { parts: [{text: 'test2'}], role: 1, @@ -343,7 +343,7 @@ describeWithEnvironment('AiAgent', () => { const responses = await Array.fromAsync(agent.run('query', {selected: mockConversationContext()})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: ResponseType.USER_QUERY, query: 'query', @@ -385,7 +385,7 @@ describeWithEnvironment('AiAgent', () => { await Array.fromAsync(agent.run('query', {selected: mockConversationContext()})); - assert.deepStrictEqual(agent.chatHistoryForTesting, [ + assert.deepEqual(agent.chatHistoryForTesting, [ { role: Host.AidaClient.Role.USER, parts: [{text: 'query'}], @@ -407,7 +407,7 @@ describeWithEnvironment('AiAgent', () => { const responses = await Array.fromAsync(agent.run('query', {selected: mockConversationContext()})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: ResponseType.USER_QUERY, query: 'query', @@ -457,7 +457,7 @@ describeWithEnvironment('AiAgent', () => { ]; const responses = await Array.fromAsync(agent.runFromHistory()); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: ResponseType.USER_QUERY, query: 'first question', @@ -581,7 +581,7 @@ describeWithEnvironment('AiAgent', () => { aidaClient: {} as Host.AidaClient.AidaClient, }); agent.options.temperature = -1; - assert.deepStrictEqual( + assert.deepEqual( agent.buildRequest({text: 'test input'}).function_declarations, [{ description: 'test fn description', diff --git a/front_end/panels/ai_assistance/agents/FileAgent.test.ts b/front_end/panels/ai_assistance/agents/FileAgent.test.ts index c482067878..1cc1e949d9 100644 --- a/front_end/panels/ai_assistance/agents/FileAgent.test.ts +++ b/front_end/panels/ai_assistance/agents/FileAgent.test.ts @@ -103,7 +103,7 @@ describeWithMockConnection('FileAgent', () => { text: 'answer', }, ]; - assert.deepStrictEqual( + assert.deepEqual( agent.buildRequest({ text: 'test input', }), @@ -251,7 +251,7 @@ describeWithMockConnection('FileAgent', () => { const responses = await Array.fromAsync(agent.run('test', {selected: uiSourceCode ? new FileContext(uiSourceCode) : null})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: ResponseType.USER_QUERY, query: 'test', @@ -293,7 +293,7 @@ test`, }, ]); - assert.deepStrictEqual(agent.chatHistoryForTesting, [ + assert.deepEqual(agent.chatHistoryForTesting, [ { role: 1, parts: [{ diff --git a/front_end/panels/ai_assistance/agents/NetworkAgent.test.ts b/front_end/panels/ai_assistance/agents/NetworkAgent.test.ts index c9863cfd36..caf676af4d 100644 --- a/front_end/panels/ai_assistance/agents/NetworkAgent.test.ts +++ b/front_end/panels/ai_assistance/agents/NetworkAgent.test.ts @@ -95,7 +95,7 @@ describeWithMockConnection('NetworkAgent', () => { text: 'answer', }, ]; - assert.deepStrictEqual( + assert.deepEqual( agent.buildRequest({ text: 'test input', }), @@ -224,7 +224,7 @@ describeWithMockConnection('NetworkAgent', () => { const responses = await Array.fromAsync(agent.run('test', {selected: new RequestContext(selectedNetworkRequest)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: ResponseType.USER_QUERY, query: 'test', @@ -267,7 +267,7 @@ describeWithMockConnection('NetworkAgent', () => { rpcId: 123, }, ]); - assert.deepStrictEqual(agent.chatHistoryForTesting, [ + assert.deepEqual(agent.chatHistoryForTesting, [ { role: 1, parts: [{ diff --git a/front_end/panels/ai_assistance/agents/PerformanceAgent.test.ts b/front_end/panels/ai_assistance/agents/PerformanceAgent.test.ts index ed70477cca..47ed6339f1 100644 --- a/front_end/panels/ai_assistance/agents/PerformanceAgent.test.ts +++ b/front_end/panels/ai_assistance/agents/PerformanceAgent.test.ts @@ -76,7 +76,7 @@ describeWithEnvironment('PerformanceAgent', () => { text: 'answer', }, ]; - assert.deepStrictEqual( + assert.deepEqual( agent.buildRequest({ text: 'test input', }), @@ -151,7 +151,7 @@ dur: 3 self: 3 `.trim(); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: ResponseType.USER_QUERY, query: 'test', @@ -175,7 +175,7 @@ self: 3 }, ]); - assert.deepStrictEqual(agent.chatHistoryForTesting, [ + assert.deepEqual(agent.chatHistoryForTesting, [ { role: 1, parts: [{text: `${aiCallTree.serialize()}\n\n# User request\n\ntest`}], diff --git a/front_end/panels/ai_assistance/agents/StylingAgent.test.ts b/front_end/panels/ai_assistance/agents/StylingAgent.test.ts index b02b871134..1249e53c0c 100644 --- a/front_end/panels/ai_assistance/agents/StylingAgent.test.ts +++ b/front_end/panels/ai_assistance/agents/StylingAgent.test.ts @@ -52,21 +52,21 @@ describeWithEnvironment('StylingAgent', () => { it('parses a thought', async () => { const payload = 'some response'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`THOUGHT: ${payload}`), { title: undefined, thought: payload, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(` THOUGHT: ${payload}`), { title: undefined, thought: payload, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`Something\n THOUGHT: ${payload}`), { title: undefined, @@ -76,21 +76,21 @@ describeWithEnvironment('StylingAgent', () => { }); it('parses a answer', async () => { const payload = 'some response'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ANSWER: ${payload}`), { answer: payload, suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(` ANSWER: ${payload}`), { answer: payload, suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`Something\n ANSWER: ${payload}`), { answer: payload, @@ -102,35 +102,35 @@ describeWithEnvironment('StylingAgent', () => { const payload = `a b c`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ANSWER: ${payload}`), { answer: payload, suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(` ANSWER: ${payload}`), { answer: payload, suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`Something\n ANSWER: ${payload}`), { answer: payload, suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ANSWER: ${payload}\nTHOUGHT: thought`), { answer: payload, suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `ANSWER: ${payload}\nOBSERVATION: observation`, ), @@ -139,7 +139,7 @@ c`; suggestions: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `ANSWER: ${payload}\nACTION\naction\nSTOP`, ), @@ -154,7 +154,7 @@ c`; const payload = `const data = { someKey: "value", }`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n${payload}\nSTOP`), { action: payload, @@ -162,7 +162,7 @@ c`; thought: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n${payload}`), { action: payload, @@ -170,7 +170,7 @@ c`; thought: undefined, }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n\n${payload}\n\nSTOP`), { action: payload, @@ -179,7 +179,7 @@ c`; }, ); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n\n${payload}\n\nANSWER: answer`), { action: payload, @@ -193,7 +193,7 @@ c`; const data = { styles };`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n${payload}STOP`), { action: payload, @@ -205,7 +205,7 @@ c`; it('parses a thought and title', async () => { const payload = 'some response'; const title = 'this is the title'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`THOUGHT: ${payload}\nTITLE: ${title}`), { thought: payload, @@ -218,7 +218,7 @@ c`; const payload = `const data = { someKey: "value", }`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `ACTION\n\`\`\`\n${payload}\n\`\`\`\nSTOP`, ), @@ -234,7 +234,7 @@ c`; const payload = `const data = { someKey: "value", }`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `ACTION\n\`\`\`\`\`\njs\n${payload}\n\`\`\`\`\`\nSTOP`, ), @@ -251,7 +251,7 @@ c`; someKey: "value", }`; const thoughtPayload = 'thought'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `THOUGHT:${thoughtPayload}\nACTION\n${actionPayload}\nSTOP`, ), @@ -266,7 +266,7 @@ c`; it('parses a thought and an answer', async () => { const answerPayload = 'answer'; const thoughtPayload = 'thought'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `THOUGHT:${thoughtPayload}\nANSWER:${answerPayload}`, ), @@ -281,7 +281,7 @@ c`; const answerPayload = 'answer'; const suggestions = ['suggestion'] as [string]; const suggestionsText = JSON.stringify(suggestions); - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `ANSWER:${answerPayload}\nSUGGESTIONS: ${suggestionsText}`, ), @@ -299,7 +299,7 @@ c`; someKey: "value", }`; const title = 'title'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `THOUGHT: ${thoughtPayload}\nTITLE: ${title}\nACTION\n${actionPayload}\nSTOP\nANSWER:${answerPayload}`, ), @@ -317,7 +317,7 @@ c`; const data = { styles };`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( `ACTION\n${payload}STOP\nANSWER:${answerPayload}\nSUGGESTIONS: ${JSON.stringify(suggestions)}`), { @@ -332,7 +332,7 @@ c`; const data = { styles };`; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n${payload}STOP\nOBSERVATION:{styles: {}}`), { action: payload, @@ -347,7 +347,7 @@ c`; styles };`; const thoughtPayload = 'thought'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`ACTION\n${payload}STOP\nTHOUGHT:${thoughtPayload}`), { action: payload, @@ -358,7 +358,7 @@ c`; }); it('parses a response as an answer', async () => { - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( 'This is also an answer', ), @@ -370,7 +370,7 @@ c`; }); it('parses a response with no instruction tags as an answer and correctly parses suggestions', async () => { - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse( 'This is also an answer\nSUGGESTIONS: [\"suggestion\"]', ), @@ -383,7 +383,7 @@ c`; it('parses multi line thoughts', () => { const thoughtText = 'first line\nsecond line'; - assert.deepStrictEqual( + assert.deepEqual( getParsedTextResponse(`THOUGHT: ${thoughtText}`), { thought: thoughtText, @@ -538,7 +538,7 @@ c`; text: 'answer', }, ]; - assert.deepStrictEqual( + assert.deepEqual( agent.buildRequest({ text: 'test input', }), @@ -807,7 +807,7 @@ c`; }); const responses = await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', @@ -834,7 +834,7 @@ c`; }, ]); sinon.assert.notCalled(execJs); - assert.deepStrictEqual(agent.chatHistoryForTesting, [ + assert.deepEqual(agent.chatHistoryForTesting, [ { role: 1, parts: [{text: '# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test'}], @@ -886,12 +886,12 @@ STOP`, assert.isUndefined(requests[0].historical_contexts, 'Unexpected historical contexts in the initial request'); assert.exists(requests[0].current_message); assert.lengthOf(requests[0].current_message.parts, 1); - assert.deepStrictEqual( + assert.deepEqual( requests[0].current_message.parts[0], {text: '# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test'}, 'Unexpected input text in the initial request'); assert.strictEqual(requests[0].current_message.role, Host.AidaClient.Role.USER); - assert.deepStrictEqual( + assert.deepEqual( requests[1].historical_contexts, [ { @@ -909,7 +909,7 @@ STOP`, 'Unexpected historical contexts in the follow-up request'); assert.exists(requests[1].current_message); assert.lengthOf(requests[1].current_message.parts, 1); - assert.deepStrictEqual( + assert.deepEqual( requests[1].current_message.parts[0], {text: 'OBSERVATION: test data'}, 'Unexpected input in the follow-up request'); }); @@ -932,7 +932,7 @@ STOP`, }); const responses = await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', @@ -978,7 +978,7 @@ STOP`, }); const responses = await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', @@ -1030,7 +1030,7 @@ STOP`, }); const responses = await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', @@ -1110,7 +1110,7 @@ STOP execJs, }); const responses = await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', @@ -1135,7 +1135,7 @@ STOP }, ]); sinon.assert.notCalled(execJs); - assert.deepStrictEqual(agent.chatHistoryForTesting, []); + assert.deepEqual(agent.chatHistoryForTesting, []); }); it('generates an action response if action and answer both present', async () => { @@ -1172,7 +1172,7 @@ ANSWER: this is the answer`, }); const responses = await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(responses, [ + assert.deepEqual(responses, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', @@ -1245,7 +1245,7 @@ ANSWER: this is the answer`, await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(agent.chatHistoryForTesting, [ + assert.deepEqual(agent.chatHistoryForTesting, [ { role: 1, parts: [{text: '# Inspected element\n\n* Its selector is `undefined`\n\n# User request\n\nQUERY: test'}], @@ -1315,7 +1315,7 @@ ANSWER: this is the answer`, await Array.fromAsync( agent.run('test', {selected: new AiAssistance.NodeContext(element), signal: controller.signal})); - assert.deepStrictEqual(agent.chatHistoryForTesting, []); + assert.deepEqual(agent.chatHistoryForTesting, []); }); }); @@ -1354,7 +1354,7 @@ ANSWER: this is the answer`, await Array.fromAsync(agent.run('test', {selected: new AiAssistance.NodeContext(element)})); - assert.deepStrictEqual(historyStub.lastCall.args[0].history, [ + assert.deepEqual(historyStub.lastCall.args[0].history, [ { type: AiAssistance.ResponseType.USER_QUERY, query: 'test', diff --git a/front_end/panels/application/AppManifestView.test.ts b/front_end/panels/application/AppManifestView.test.ts index 13b4e28e74..8a254024b5 100644 --- a/front_end/panels/application/AppManifestView.test.ts +++ b/front_end/panels/application/AppManifestView.test.ts @@ -108,14 +108,14 @@ describeWithMockConnection('AppManifestView', () => { height: 512, formatted: '512×512px', } as Application.AppManifestView.ParsedSize]; - assert.deepStrictEqual(parsed, expected); + assert.deepEqual(parsed, expected); }); it('can handle missing ‘sizes’-field', async () => { view = new Application.AppManifestView.AppManifestView(emptyView, reportView, throttler); const parsed = view.parseSizes( undefined as unknown as string, 'Icon' as Platform.UIString.LocalizedString, 'https://web.dev/image.html', []); - assert.deepStrictEqual(parsed, []); + assert.deepEqual(parsed, []); }); async function renderWithWarnings(manifest: string): Promise { @@ -181,7 +181,7 @@ describeWithMockConnection('AppManifestView', () => { 'Richer PWA Install UI won’t be available on mobile. Please add at least one screenshot for which form_factor is not set or set to a value other than wide.', 'Most operating systems require square icons. Please include at least one square icon in the array.', ]; - assert.deepStrictEqual(actual, expected); + assert.deepEqual(actual, expected); }); it('displays warnings for too many mobile screenshots', async () => { @@ -224,7 +224,7 @@ describeWithMockConnection('AppManifestView', () => { 'No more than 5 screenshots will be displayed on mobile. The rest will be ignored.', 'Most operating systems require square icons. Please include at least one square icon in the array.', ]; - assert.deepStrictEqual(actual, expected); + assert.deepEqual(actual, expected); }); it('displays warnings for too many desktop screenshots and wrong aspect ratio', async () => { @@ -292,7 +292,7 @@ describeWithMockConnection('AppManifestView', () => { 'No more than 8 screenshots will be displayed on desktop. The rest will be ignored.', 'Most operating systems require square icons. Please include at least one square icon in the array.', ]; - assert.deepStrictEqual(actual, expected); + assert.deepEqual(actual, expected); }); it('displays "form-factor", "platform" and "label" properties for screenshots', async () => { @@ -312,10 +312,10 @@ describeWithMockConnection('AppManifestView', () => { const screenshotSection = reportView.element.shadowRoot?.querySelectorAll('.report-section')[7] || null; assert.instanceOf(screenshotSection, HTMLDivElement); - assert.deepStrictEqual( + assert.deepEqual( getCleanTextContentFromElements(screenshotSection, '.report-field-name').slice(0, 3), ['Form factor', 'Label', 'Platform']); - assert.deepStrictEqual( + assert.deepEqual( getCleanTextContentFromElements(screenshotSection, '.report-field-value').slice(0, 3), ['wide', 'Dummy Screenshot', 'windows']); }); diff --git a/front_end/panels/application/ApplicationPanelSidebar.test.ts b/front_end/panels/application/ApplicationPanelSidebar.test.ts index 348b6d5adc..3078fc0c8b 100644 --- a/front_end/panels/application/ApplicationPanelSidebar.test.ts +++ b/front_end/panels/application/ApplicationPanelSidebar.test.ts @@ -145,7 +145,7 @@ describeWithMockConnection('ApplicationPanelSidebar', () => { resourceTreeModel.dispatchEventToListeners(SDK.ResourceTreeModel.Events.CachedResourcesLoaded, resourceTreeModel); assert.strictEqual(sidebar.cookieListTreeElement.childCount(), 2); - assert.deepStrictEqual( + assert.deepEqual( sidebar.cookieListTreeElement.children().map(e => e.title), ['http://www.example.com', 'http://www.example.org']); }); @@ -180,7 +180,7 @@ describeWithMockConnection('ApplicationPanelSidebar', () => { assert.isTrue(setTrackingSpy.calledOnceWithExactly({enable: true})); assert.strictEqual(sidebar.sharedStorageListTreeElement.childCount(), 3); - assert.deepStrictEqual(sidebar.sharedStorageListTreeElement.children().map(e => e.title), [ + assert.deepEqual(sidebar.sharedStorageListTreeElement.children().map(e => e.title), [ TEST_ORIGIN_A, TEST_ORIGIN_B, TEST_ORIGIN_C, @@ -221,12 +221,11 @@ describeWithMockConnection('ApplicationPanelSidebar', () => { if (useTreeView) { assert.strictEqual(sidebar.extensionStorageListTreeElement!.childCount(), 1); assert.strictEqual(sidebar.extensionStorageListTreeElement!.children()[0].title, TEST_EXTENSION_NAME); - assert.deepStrictEqual( + assert.deepEqual( sidebar.extensionStorageListTreeElement!.children()[0].children().map(e => e.title), ['Session', 'Local']); } else { assert.strictEqual(sidebar.extensionStorageListTreeElement!.childCount(), 2); - assert.deepStrictEqual( - sidebar.extensionStorageListTreeElement!.children().map(e => e.title), ['Session', 'Local']); + assert.deepEqual(sidebar.extensionStorageListTreeElement!.children().map(e => e.title), ['Session', 'Local']); } extensionStorageModel.dispatchEventToListeners( diff --git a/front_end/panels/application/DOMStorageModel.test.ts b/front_end/panels/application/DOMStorageModel.test.ts index 83336d08a7..f5b45a175a 100644 --- a/front_end/panels/application/DOMStorageModel.test.ts +++ b/front_end/panels/application/DOMStorageModel.test.ts @@ -23,7 +23,7 @@ describeWithMockConnection('DOMStorageModel', () => { it('DOMStorage is instantiated correctly', () => { assert.strictEqual(domStorage.storageKey, initKey); - assert.deepStrictEqual(domStorage.id, {storageKey: initKey, isLocalStorage: true} as Protocol.DOMStorage.StorageId); + assert.deepEqual(domStorage.id, {storageKey: initKey, isLocalStorage: true} as Protocol.DOMStorage.StorageId); }); it('StorageKey events trigger addition/removal of DOMStorage', () => { diff --git a/front_end/panels/application/InterestGroupTreeElement.test.ts b/front_end/panels/application/InterestGroupTreeElement.test.ts index d919417304..36ac993d73 100644 --- a/front_end/panels/application/InterestGroupTreeElement.test.ts +++ b/front_end/panels/application/InterestGroupTreeElement.test.ts @@ -32,6 +32,6 @@ describeWithMockConnection('InterestGroupTreeElement', () => { .withArgs({ownerOrigin: OWNER, name: NAME}) .returns(Promise.resolve({details: DETAILS} as Protocol.Storage.GetInterestGroupDetailsResponse)); const details = await view.getInterestGroupDetails(OWNER, NAME); - assert.deepStrictEqual(details, DETAILS); + assert.deepEqual(details, DETAILS); }); }); diff --git a/front_end/panels/application/components/BackForwardCacheView.test.ts b/front_end/panels/application/components/BackForwardCacheView.test.ts index 84280a9e55..cc0b729f45 100644 --- a/front_end/panels/application/components/BackForwardCacheView.test.ts +++ b/front_end/panels/application/components/BackForwardCacheView.test.ts @@ -110,7 +110,7 @@ describeWithMockConnection('BackForwardCacheView', () => { const component = await renderBackForwardCacheView(); const sectionHeaders = component.shadowRoot!.querySelectorAll('devtools-report-section-header'); const sectionHeadersText = Array.from(sectionHeaders).map(sectionHeader => sectionHeader.textContent?.trim()); - assert.deepStrictEqual(sectionHeadersText, ['Actionable', 'Pending Support', 'Not Actionable']); + assert.deepEqual(sectionHeadersText, ['Actionable', 'Pending Support', 'Not Actionable']); const sections = component.shadowRoot!.querySelectorAll('devtools-report-section'); const sectionsText = Array.from(sections).map(section => section.textContent?.trim()); @@ -122,7 +122,7 @@ describeWithMockConnection('BackForwardCacheView', () => { 'Pages whose main resource has cache-control:no-store cannot enter back/forward cache.', 'Learn more: back/forward cache eligibility', ]; - assert.deepStrictEqual(sectionsText, expected); + assert.deepEqual(sectionsText, expected); }); it('renders explanation tree', async () => { @@ -201,7 +201,7 @@ describeWithMockConnection('BackForwardCacheView', () => { }, ]; - assert.deepStrictEqual(treeData, expected); + assert.deepEqual(treeData, expected); }); it('renders blocking details if available', async () => { @@ -226,7 +226,7 @@ describeWithMockConnection('BackForwardCacheView', () => { const component = await renderBackForwardCacheView(); const sectionHeaders = component.shadowRoot!.querySelectorAll('devtools-report-section-header'); const sectionHeadersText = Array.from(sectionHeaders).map(sectionHeader => sectionHeader.textContent?.trim()); - assert.deepStrictEqual(sectionHeadersText, ['Pending Support']); + assert.deepEqual(sectionHeadersText, ['Pending Support']); const sections = component.shadowRoot!.querySelectorAll('devtools-report-section'); const sectionsText = Array.from(sections).map(section => section.textContent?.trim()); @@ -236,13 +236,13 @@ describeWithMockConnection('BackForwardCacheView', () => { 'Pages that use WebLocks are not currently eligible for back/forward cache.', 'Learn more: back/forward cache eligibility', ]; - assert.deepStrictEqual(sectionsText, expected); + assert.deepEqual(sectionsText, expected); const details = component.shadowRoot!.querySelector('.details-list devtools-expandable-list'); details!.shadowRoot!.querySelector('button')!.click(); const items = details!.shadowRoot!.querySelectorAll('.expandable-list-items .devtools-link'); const detailsText = Array.from(items).map(detail => detail.textContent?.trim()); - assert.deepStrictEqual(detailsText, ['www.example.com/index.html:11:6', 'www.example.com/script.js:16:21']); + assert.deepEqual(detailsText, ['www.example.com/index.html:11:6', 'www.example.com/script.js:16:21']); }); it('can handle delayed navigation history when testing for BFcache availability', async () => { diff --git a/front_end/panels/application/components/BounceTrackingMitigationsView.test.ts b/front_end/panels/application/components/BounceTrackingMitigationsView.test.ts index ee0446c188..3416ec7cc7 100644 --- a/front_end/panels/application/components/BounceTrackingMitigationsView.test.ts +++ b/front_end/panels/application/components/BounceTrackingMitigationsView.test.ts @@ -60,7 +60,7 @@ describeWithMockConnection('BounceTrackingMitigationsView', () => { 'Learn more: Bounce Tracking Mitigations', ]; - assert.deepStrictEqual(sectionsText, expected); + assert.deepEqual(sectionsText, expected); }); it('shows a message explaining that Bounce Tracking Mitigations must be enabled to use the panel', async () => { @@ -79,7 +79,7 @@ describeWithMockConnection('BounceTrackingMitigationsView', () => { 'Bounce tracking mitigations are disabled. To enable them, set the flag at Bounce Tracking Mitigations Feature Flag to "Enabled With Deletion".', ]; - assert.deepStrictEqual(sectionsText, expected); + assert.deepEqual(sectionsText, expected); }); it('hides deleted sites table and shows explanation message when there are no deleted tracking sites', async () => { @@ -113,7 +113,7 @@ describeWithMockConnection('BounceTrackingMitigationsView', () => { 'Learn more: Bounce Tracking Mitigations', ]; - assert.deepStrictEqual(sectionsText, expected); + assert.deepEqual(sectionsText, expected); }); it('renders deleted sites in a table', async () => { diff --git a/front_end/panels/autofill/AutofillView.test.ts b/front_end/panels/autofill/AutofillView.test.ts index 9f96ef0798..6fceaecd5c 100644 --- a/front_end/panels/autofill/AutofillView.test.ts +++ b/front_end/panels/autofill/AutofillView.test.ts @@ -121,7 +121,7 @@ describeWithMockConnection('AutofillView', () => { const assertViewShowsEventData = (view: Autofill.AutofillView.AutofillView) => { const addressSpans = view.shadowRoot!.querySelectorAll('.address span'); const addressText = [...addressSpans].map(div => div.textContent); - assert.deepStrictEqual( + assert.deepEqual( addressText, ['Crocodile', ' Middle ', 'Dundee', 'Uluru ToursOutback Road 1Bundaberg Queensland ', '12345']); const expectedHeaders = ['Form field', 'Predicted autofill value', 'Value', 'filledFieldIndex']; const expectedRows = [ diff --git a/front_end/panels/console/ConsoleView.test.ts b/front_end/panels/console/ConsoleView.test.ts index c0dccc46ae..8dce2fdc25 100644 --- a/front_end/panels/console/ConsoleView.test.ts +++ b/front_end/panels/console/ConsoleView.test.ts @@ -227,7 +227,7 @@ describeWithMockConnection('ConsoleView', () => { SDK.ConsoleModel.Events.MessageAdded, createConsoleMessage(target, 'await new Promise(() => ())', SDK.ConsoleModel.FrontendMessageType.Command)); - assert.deepStrictEqual(consoleHistorySetting.get(), ['await new Promise(() => ())']); + assert.deepEqual(consoleHistorySetting.get(), ['await new Promise(() => ())']); }); it('keeps updating the issue counter when re-attached after detaching', async () => { diff --git a/front_end/panels/console/ErrorStackParser.test.ts b/front_end/panels/console/ErrorStackParser.test.ts index 20b784c7b2..20dcb01ad5 100644 --- a/front_end/panels/console/ErrorStackParser.test.ts +++ b/front_end/panels/console/ErrorStackParser.test.ts @@ -84,7 +84,7 @@ describe('ErrorStackParser', () => { at foo (file:///testing.js:10:3)`); assert.exists(frames); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url: fileTestingUrl, prefix: ' at foo (', suffix: ')', @@ -99,7 +99,7 @@ describe('ErrorStackParser', () => { at foo (file:///testing.js)`); assert.exists(frames); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url: fileTestingUrl, prefix: ' at foo (', suffix: ')', @@ -114,7 +114,7 @@ describe('ErrorStackParser', () => { at file:///testing.js:42:3`); assert.exists(frames); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url: fileTestingUrl, prefix: ' at ', suffix: '', @@ -129,7 +129,7 @@ describe('ErrorStackParser', () => { at async file:///testing.js:42:3`); assert.exists(frames); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url: fileTestingUrl, prefix: ' at async ', suffix: '', @@ -148,7 +148,7 @@ describe('ErrorStackParser', () => { assert.exists(frames); assert.lengthOf(frames, 3); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url, prefix: ' at load (', suffix: ')', @@ -156,7 +156,7 @@ describe('ErrorStackParser', () => { columnNumber: 4, // 0-based. enclosedInBraces: true, }); - assert.deepStrictEqual(frames[2].link, { + assert.deepEqual(frames[2].link, { url, prefix: ' at ', suffix: '', @@ -173,7 +173,7 @@ describe('ErrorStackParser', () => { assert.exists(frames); assert.lengthOf(frames, 2); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url, prefix: ' at eval (eval at (', suffix: '), :1:1)', @@ -198,7 +198,7 @@ describe('ErrorStackParser', () => { assert.exists(frames); assert.lengthOf(frames, 3); - assert.deepStrictEqual(frames[2].link, { + assert.deepEqual(frames[2].link, { url: 'http://www.example.org/inspected-page.html' as Platform.DevToolsPath.UrlString, prefix: ' at eval (eval at testFunction (', suffix: '), :1:10)', @@ -216,7 +216,7 @@ describe('ErrorStackParser', () => { assert.exists(frames); assert.lengthOf(frames, 4); - assert.deepStrictEqual(frames[1].link, { + assert.deepEqual(frames[1].link, { url: 'http://www.example.org/(abc)/foo.js' as Platform.DevToolsPath.UrlString, prefix: ' at foo (', suffix: ')', @@ -224,7 +224,7 @@ describe('ErrorStackParser', () => { columnNumber: 2, // 0-based. enclosedInBraces: true, }); - assert.deepStrictEqual(frames[2].link, { + assert.deepEqual(frames[2].link, { url: 'http://www.example.org/(abc)/foo.js' as Platform.DevToolsPath.UrlString, prefix: ' at async bar (', suffix: ')', @@ -232,7 +232,7 @@ describe('ErrorStackParser', () => { columnNumber: 1, // 0-based. enclosedInBraces: true, }); - assert.deepStrictEqual(frames[3].link, { + assert.deepEqual(frames[3].link, { url: 'http://www.example.org/(abc)/foo.js' as Platform.DevToolsPath.UrlString, prefix: ' at ', suffix: '', diff --git a/front_end/panels/elements/PropertyMatchers.test.ts b/front_end/panels/elements/PropertyMatchers.test.ts index 97bf5d5721..28aaa14ffb 100644 --- a/front_end/panels/elements/PropertyMatchers.test.ts +++ b/front_end/panels/elements/PropertyMatchers.test.ts @@ -153,7 +153,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { new Elements.PropertyMatchers.ColorMixMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual(match.space.map(n => ast.text(n)), ['in', 'srgb', 'var(--interpolation)', 'hue']); + assert.deepEqual(match.space.map(n => ast.text(n)), ['in', 'srgb', 'var(--interpolation)', 'hue']); assert.strictEqual(match.color1.map(n => ast.text(n)).join(), 'red,var(--percentage)'); assert.strictEqual(match.color2.map(n => ast.text(n)).join(), 'rgb(var(--rgb))'); } @@ -189,7 +189,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual(match.space.map(n => ast.text(n)).join(' '), space, text); + assert.deepEqual(match.space.map(n => ast.text(n)).join(' '), space, text); assert.strictEqual(match.color1.map(n => ast.text(n)).join(' '), color1, text); assert.strictEqual(match.color2.map(n => ast.text(n)).join(' '), color2, text); } @@ -252,41 +252,40 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { return matches.map(m => matchedResult.getMatch(m)?.text); } - assert.deepStrictEqual(match('animation-name', 'first, second, -moz-third'), ['first', 'second', '-moz-third']); - assert.deepStrictEqual(match('animation-name', 'first'), ['first']); - assert.deepStrictEqual(match('font-palette', 'first'), ['first']); + assert.deepEqual(match('animation-name', 'first, second, -moz-third'), ['first', 'second', '-moz-third']); + assert.deepEqual(match('animation-name', 'first'), ['first']); + assert.deepEqual(match('font-palette', 'first'), ['first']); { - assert.deepStrictEqual(match('position-try-fallbacks', 'flip-block'), []); - assert.deepStrictEqual(match('position-try-fallbacks', '--one'), ['--one']); - assert.deepStrictEqual(match('position-try-fallbacks', '--one, --two'), ['--one', '--two']); + assert.deepEqual(match('position-try-fallbacks', 'flip-block'), []); + assert.deepEqual(match('position-try-fallbacks', '--one'), ['--one']); + assert.deepEqual(match('position-try-fallbacks', '--one, --two'), ['--one', '--two']); } { - assert.deepStrictEqual(match('position-try', 'flip-block'), []); - assert.deepStrictEqual(match('position-try', '--one'), ['--one']); - assert.deepStrictEqual(match('position-try', '--one, --two'), ['--one', '--two']); + assert.deepEqual(match('position-try', 'flip-block'), []); + assert.deepEqual(match('position-try', '--one'), ['--one']); + assert.deepEqual(match('position-try', '--one, --two'), ['--one', '--two']); } { injectVariableSubstitutions({ '--duration-and-easing': '1s linear', }); - assert.deepStrictEqual(match('animation', '1s linear --animation-name'), ['--animation-name']); - assert.deepStrictEqual(match('animation', '1s linear linear'), ['linear']); - assert.deepStrictEqual( + assert.deepEqual(match('animation', '1s linear --animation-name'), ['--animation-name']); + assert.deepEqual(match('animation', '1s linear linear'), ['linear']); + assert.deepEqual( match('animation', '1s linear --first-name, 1s ease-in --second-name'), ['--first-name', '--second-name']); - assert.deepStrictEqual(match('animation', '1s linear'), []); + assert.deepEqual(match('animation', '1s linear'), []); // Matching to variable names inside `var()` functions are fine as it is handled by variable renderer in usage. - assert.deepStrictEqual( - match('animation', 'var(--duration-and-easing) linear'), ['--duration-and-easing', 'linear']); - assert.deepStrictEqual( + assert.deepEqual(match('animation', 'var(--duration-and-easing) linear'), ['--duration-and-easing', 'linear']); + assert.deepEqual( match('animation', '1s linear var(--non-existent, --animation-name)'), ['--non-existent', '--animation-name']); - assert.deepStrictEqual(match('animation', '1s step-start 0s kf'), ['kf']); - assert.deepStrictEqual(match('animation', '1s step-end 0s kf'), ['kf']); - assert.deepStrictEqual(match('animation', '1s steps(1, jump-start) 0s kf'), ['kf']); - assert.deepStrictEqual(match('animation', '1s steps(1, jump-end) 0s kf'), ['kf']); - assert.deepStrictEqual(match('animation', '1s steps(1, jump-none) 0s kf'), ['kf']); - assert.deepStrictEqual(match('animation', '1s steps(1, start) 0s kf'), ['kf']); - assert.deepStrictEqual(match('animation', '1s steps(1, end) 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s step-start 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s step-end 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s steps(1, jump-start) 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s steps(1, jump-end) 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s steps(1, jump-none) 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s steps(1, start) 0s kf'), ['kf']); + assert.deepEqual(match('animation', '1s steps(1, end) 0s kf'), ['kf']); } }); @@ -348,7 +347,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { const matches = SDK.CSSPropertyParser.TreeSearch.findAll( ast, node => matchedResult.getMatch(node) instanceof Elements.PropertyMatchers.FontMatch); - assert.deepStrictEqual(matches.map(m => matchedResult.getMatch(m)?.text), ['"Gill Sans"', 'sans-serif']); + assert.deepEqual(matches.map(m => matchedResult.getMatch(m)?.text), ['"Gill Sans"', 'sans-serif']); } }); @@ -371,7 +370,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { 'grid-template-areas', '"a a a" "b b b" "c c c"', new Elements.PropertyMatchers.GridTemplateMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual( + assert.deepEqual( match.lines.map(line => line.map(n => ast.text(n)).join(' ')), ['"a a a"', '"b b b"', '"c c c"']); } { @@ -379,7 +378,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { 'grid-template', '"a a a" var(--row) / auto 1fr auto', new Elements.PropertyMatchers.GridTemplateMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual( + assert.deepEqual( match.lines.map(line => line.map(n => ast.text(n)).join(' ')), ['"a a a"', 'var(--row) / auto 1fr auto']); } { @@ -389,7 +388,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { new Elements.PropertyMatchers.GridTemplateMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual( + assert.deepEqual( match.lines.map(line => line.map(n => ast.text(n)).join(' ')), ['[header-top] "a a" var(--row-with-names)', '[main-top] "b b b" 1fr [main-bottom] / auto 1fr auto']); } @@ -400,7 +399,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { new Elements.PropertyMatchers.GridTemplateMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual( + assert.deepEqual( match.lines.map(line => line.map(n => ast.text(n)).join(' ')), ['[header-top] "a a"', '"b b b" var(--line-name)', '"c c" / auto 1fr auto']); } @@ -411,7 +410,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { new Elements.PropertyMatchers.GridTemplateMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual( + assert.deepEqual( match.lines.map(line => line.map(n => ast.text(n)).join(' ')), ['[line1] "a a" [line2]', 'var(--double-row)', '"b b" / auto 1fr auto']); } @@ -420,7 +419,7 @@ describe('Matchers for SDK.CSSPropertyParser.BottomUpTreeMatching', () => { 'grid', '"a a" var(--unresolved) / auto 1fr auto;', new Elements.PropertyMatchers.GridTemplateMatcher()); assert.exists(ast, text); assert.exists(match, text); - assert.deepStrictEqual( + assert.deepEqual( match.lines.map(line => line.map(n => ast.text(n)).join(' ')), ['"a a" var(--unresolved) / auto 1fr auto']); } }); diff --git a/front_end/panels/elements/PropertyRenderer.test.ts b/front_end/panels/elements/PropertyRenderer.test.ts index 2d12aeda29..26c6099b25 100644 --- a/front_end/panels/elements/PropertyRenderer.test.ts +++ b/front_end/panels/elements/PropertyRenderer.test.ts @@ -18,17 +18,17 @@ describeWithEnvironment('PropertyRenderer', () => { it('parses text', () => { // Prevent normaliztaion to get an accurate representation of the parser result. sinon.stub(Element.prototype, 'normalize'); - assert.deepStrictEqual( + assert.deepEqual( textFragments( Array.from(Elements.PropertyRenderer.Renderer.renderValueElement('--p', 'var(--v)', []).childNodes)), ['var', '(', '--v', ')']); - assert.deepStrictEqual( + assert.deepEqual( textFragments(Array.from( Elements.PropertyRenderer.Renderer.renderValueElement('--p', '/* comments are text */ 1px solid 4', []) .childNodes)), ['/* comments are text */', ' ', '1px', ' ', 'solid', ' ', '4']); - assert.deepStrictEqual( + assert.deepEqual( textFragments(Array.from( Elements.PropertyRenderer.Renderer .renderValueElement('--p', '2px var(--double, var(--fallback, black)) #32a1ce rgb(124 125 21 0)', []) @@ -47,7 +47,7 @@ describeWithEnvironment('PropertyRenderer', () => { const ast = new SDK.CSSPropertyParser.SyntaxTree(property, rule, tree); const matchedResult = SDK.CSSPropertyParser.BottomUpTreeMatching.walk(ast, []); const context = new Elements.PropertyRenderer.RenderingContext(ast, new Map(), matchedResult); - assert.deepStrictEqual( + assert.deepEqual( textFragments(Elements.PropertyRenderer.Renderer.render(tree, context).nodes).join(''), rule, Printer.walk(ast).get()); }); @@ -60,7 +60,7 @@ describeWithEnvironment('PropertyRenderer', () => { const ast = new SDK.CSSPropertyParser.SyntaxTree(property, rule, tree); const matchedResult = SDK.CSSPropertyParser.BottomUpTreeMatching.walk(ast, []); const context = new Elements.PropertyRenderer.RenderingContext(ast, new Map(), matchedResult); - assert.deepStrictEqual( + assert.deepEqual( textFragments(Elements.PropertyRenderer.Renderer.render(tree, context).nodes).join(''), property, Printer.walk(ast).get()); }); diff --git a/front_end/panels/elements/StylePropertyTreeElement.test.ts b/front_end/panels/elements/StylePropertyTreeElement.test.ts index 30b00212f8..06094743f7 100644 --- a/front_end/panels/elements/StylePropertyTreeElement.test.ts +++ b/front_end/panels/elements/StylePropertyTreeElement.test.ts @@ -247,8 +247,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => { assert.strictEqual(outerColorMix.getText(), 'color-mix(in srgb, color-mix(in oklch, red, green), blue)'); assert.strictEqual(innerColorMix.getText(), 'color-mix(in oklch, red, green)'); innerColorMix.setFirstColor('blue'); - assert.deepStrictEqual( - handler.args[0][0].data, {text: 'color-mix(in srgb, color-mix(in oklch, blue, green), blue)'}); + assert.deepEqual(handler.args[0][0].data, {text: 'color-mix(in srgb, color-mix(in oklch, blue, green), blue)'}); assert.strictEqual(outerColorMix.getText(), 'color-mix(in srgb, color-mix(in oklch, blue, green), blue)'); // setFirstColor does not actually update the rendered color swatches or the textContent, which is why the first @@ -259,7 +258,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => { assert.isOk(newColor); colorSwatch.setColor(newColor); assert.strictEqual(outerColorMix.getText(), 'color-mix(in srgb, color-mix(in oklch, #ff0000, green), blue)'); - assert.deepStrictEqual( + assert.deepEqual( handler.args[1][0].data, {text: 'color-mix(in srgb, color-mix(in oklch, #ff0000, green), blue)'}); }); }); @@ -781,17 +780,17 @@ describeWithMockConnection('StylePropertyTreeElement', () => { return res; } - assert.deepStrictEqual( + assert.deepEqual( await matchProperty('var( --blue )'), {hasUnresolvedVars: false, computedText: 'color: blue'}); - assert.deepStrictEqual( + assert.deepEqual( await matchProperty('var(--no, var(--blue))'), {hasUnresolvedVars: false, computedText: 'color: blue'}); - assert.deepStrictEqual( + assert.deepEqual( await matchProperty('pre var(--no) post'), {hasUnresolvedVars: true, computedText: 'color: pre var(--no) post'}); - assert.deepStrictEqual( + assert.deepEqual( await matchProperty('var(--no, var(--no2))'), {hasUnresolvedVars: true, computedText: 'color: var(--no, var(--no2))'}); - assert.deepStrictEqual(await matchProperty(''), {hasUnresolvedVars: false, computedText: 'color:'}); + assert.deepEqual(await matchProperty(''), {hasUnresolvedVars: false, computedText: 'color:'}); }); it('layers correctly with the font renderer', () => { @@ -1054,7 +1053,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => { assert.instanceOf(showPopoverStub.args[0][0], InlineEditor.CSSShadowEditor.CSSShadowEditor); const editor = showPopoverStub.args[0][0] as InlineEditor.CSSShadowEditor.CSSShadowEditor; const text = editorProperties(editor); - assert.deepStrictEqual(text, ['Outset', '10px', '10px', '0', '0']); + assert.deepEqual(text, ['Outset', '10px', '10px', '0', '0']); } { @@ -1063,7 +1062,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => { assert.instanceOf(showPopoverStub.args[1][0], InlineEditor.CSSShadowEditor.CSSShadowEditor); const editor = showPopoverStub.args[1][0] as InlineEditor.CSSShadowEditor.CSSShadowEditor; const text = editorProperties(editor); - assert.deepStrictEqual(text, ['Inset', '8px', '9px', '10px', '11px']); + assert.deepEqual(text, ['Inset', '8px', '9px', '10px', '11px']); } }); @@ -1256,7 +1255,7 @@ describeWithMockConnection('StylePropertyTreeElement', () => { model.setBlurRadius(new InlineEditor.CSSShadowEditor.CSSLength(12, 'px')); model.renderContents(container); assert.strictEqual(container.textContent, '10px y 12px spread'); - assert.deepStrictEqual(properties.map(p => p.source), [null, null, null, null]); + assert.deepEqual(properties.map(p => p.source), [null, null, null, null]); }); }); diff --git a/front_end/panels/explain/PromptBuilder.test.ts b/front_end/panels/explain/PromptBuilder.test.ts index 0ad1d73630..a9c8a5d043 100644 --- a/front_end/panels/explain/PromptBuilder.test.ts +++ b/front_end/panels/explain/PromptBuilder.test.ts @@ -240,7 +240,7 @@ export const y = ""; PREAMBLE, ERROR_MESSAGE, ].join('\n')); - assert.deepStrictEqual(sources, [{type: 'message', value: ERROR_MESSAGE}]); + assert.deepEqual(sources, [{type: 'message', value: ERROR_MESSAGE}]); }); it('builds a prompt with related code', async () => { @@ -281,7 +281,7 @@ export const y = ""; '```', ].join('\n')); - assert.deepStrictEqual( + assert.deepEqual( sources, [{type: 'message', value: ERROR_MESSAGE}, {type: 'relatedCode', value: RELATED_CODE.trim()}]); Workspace.Workspace.WorkspaceImpl.instance().removeProject(project); @@ -329,7 +329,7 @@ export const y = ""; '```', ].join('\n')); - assert.deepStrictEqual(sources, [ + assert.deepEqual(sources, [ {type: 'message', value: ERROR_MESSAGE}, {type: 'stacktrace', value: STACK_TRACE}, {type: 'relatedCode', value: RELATED_CODE.trim()}, @@ -394,7 +394,7 @@ export const y = ""; '```', ].join('\n')); - assert.deepStrictEqual( + assert.deepEqual( sources, [{type: 'message', value: ERROR_MESSAGE}, {type: 'networkRequest', value: RELATED_REQUEST}]); }); @@ -415,7 +415,7 @@ export const y = ""; PREAMBLE, TRIMMED_ERROR_MESSAGE, ].join('\n')); - assert.deepStrictEqual(sources, [{type: 'message', value: TRIMMED_ERROR_MESSAGE}]); + assert.deepEqual(sources, [{type: 'message', value: TRIMMED_ERROR_MESSAGE}]); }); it('trims a very long stack trace', async () => { @@ -455,7 +455,7 @@ export const y = ""; '```', ].join('\n')); - assert.deepStrictEqual(sources, [ + assert.deepEqual(sources, [ {type: 'message', value: ERROR_MESSAGE}, {type: 'stacktrace', value: STACK_TRACE}, {type: 'relatedCode', value: RELATED_CODE.trim()}, @@ -506,7 +506,7 @@ export const y = ""; ].join('\n')); assert.isNotTrue(isPageReloadRecommended, 'PromptBuilder did recommend reloading the page'); - assert.deepStrictEqual( + assert.deepEqual( sources, [{type: 'message', value: ERROR_MESSAGE}, {type: 'networkRequest', value: RELATED_REQUEST}]); }); diff --git a/front_end/panels/issues/IssueAggregator.test.ts b/front_end/panels/issues/IssueAggregator.test.ts index 550637fe18..9e65a0e25b 100644 --- a/front_end/panels/issues/IssueAggregator.test.ts +++ b/front_end/panels/issues/IssueAggregator.test.ts @@ -51,7 +51,7 @@ describeWithEnvironment('AggregatedIssue', () => { aggregatedIssue.addInstance(issue3); const actualCookieNames = [...aggregatedIssue.cookies()].map(c => c.name).sort(); - assert.deepStrictEqual(actualCookieNames, ['cookie1', 'cookie2']); + assert.deepEqual(actualCookieNames, ['cookie1', 'cookie2']); }); }); @@ -114,7 +114,7 @@ describeWithMockConnection('IssueAggregator', () => { const issues = Array.from(aggregator.aggregatedIssues()); assert.strictEqual(issues.length, 3); const issueCodes = issues.map(r => r.aggregationKey().toString()).sort((a, b) => a.localeCompare(b)); - assert.deepStrictEqual(issueCodes, ['codeA', 'codeB', 'codeC']); + assert.deepEqual(issueCodes, ['codeA', 'codeB', 'codeC']); }); describe('aggregates issue kind', () => { @@ -190,7 +190,7 @@ describeWithMockConnection('IssueAggregator', () => { const issues = Array.from(aggregator.aggregatedIssues()); assert.strictEqual(issues.length, 1); const resolutions = [...issues[0].getHeavyAdIssues()].map(r => r.details().resolution).sort(); - assert.deepStrictEqual(resolutions, [ + assert.deepEqual(resolutions, [ Protocol.Audits.HeavyAdResolutionStatus.HeavyAdBlocked, Protocol.Audits.HeavyAdResolutionStatus.HeavyAdWarning, ]); @@ -225,7 +225,7 @@ describeWithMockConnection('IssueAggregator', () => { const issues = Array.from(aggregator.aggregatedIssues()); assert.strictEqual(issues.length, 1); const locations = [...issues[0].sources()].sort((x, y) => JSON.stringify(x).localeCompare(JSON.stringify(y))); - assert.deepStrictEqual(locations, [ + assert.deepEqual(locations, [ {url: 'bar', lineNumber: 1, columnNumber: 1, scriptId: scriptId1}, {url: 'bar', lineNumber: 1, columnNumber: 1}, {url: 'baz', lineNumber: 1, columnNumber: 1}, diff --git a/front_end/panels/lighthouse/LighthouseReportRenderer.test.ts b/front_end/panels/lighthouse/LighthouseReportRenderer.test.ts index 5c025907c0..90dd25307c 100644 --- a/front_end/panels/lighthouse/LighthouseReportRenderer.test.ts +++ b/front_end/panels/lighthouse/LighthouseReportRenderer.test.ts @@ -70,7 +70,7 @@ describeWithMockConnection('LighthouseReportRenderer', () => { await Lighthouse.LighthouseReportRenderer.LighthouseReportRenderer.linkifyNodeDetails(sourceElement); assert.strictEqual(sourceElement.childNodes.length, NUM_NODES); - assert.deepStrictEqual([...sourceElement.childNodes].map(n => n.textContent), ['link1', 'link2', 'link3']); + assert.deepEqual([...sourceElement.childNodes].map(n => n.textContent), ['link1', 'link2', 'link3']); }); it('resets tooltip', async () => { diff --git a/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.test.ts b/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.test.ts index 040f9d66ff..1462972cdc 100644 --- a/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.test.ts +++ b/front_end/panels/linear_memory_inspector/components/ValueInterpreterDisplay.test.ts @@ -229,7 +229,7 @@ describeWithLocale('ValueInterpreterDisplay', () => { const actualValues = Array.from(dataValues).map(x => x.innerText); const expectedValues = ['0x47AC8401', '0x420C0C2B47AC8401']; - assert.deepStrictEqual(actualValues, expectedValues); + assert.deepEqual(actualValues, expectedValues); }); it('renders value in selected LinearMemoryInspector.ValueInterpreterDisplayUtils.ValueTypes', () => { @@ -251,7 +251,7 @@ describeWithLocale('ValueInterpreterDisplay', () => { const actualValues = Array.from(dataValues).map(x => x.innerText); const expectedValues = ['33793', '-31743', '88328.01']; - assert.deepStrictEqual(actualValues, expectedValues); + assert.deepEqual(actualValues, expectedValues); }); it('renders only unsigned values for Octal and Hexadecimal representation', () => { @@ -288,7 +288,7 @@ describeWithLocale('ValueInterpreterDisplay', () => { const actualValues = Array.from(dataValues).map(x => x.innerText); const expectedValues = ['310', '0xC9C8', '3419064776', '-875902520']; - assert.deepStrictEqual(actualValues, expectedValues); + assert.deepEqual(actualValues, expectedValues); }); it('triggers a value changed event on selecting a new mode', async () => { diff --git a/front_end/panels/network/components/RequestHeaderSection.test.ts b/front_end/panels/network/components/RequestHeaderSection.test.ts index 35dda8c062..f7f40fa8e3 100644 --- a/front_end/panels/network/components/RequestHeaderSection.test.ts +++ b/front_end/panels/network/components/RequestHeaderSection.test.ts @@ -70,7 +70,7 @@ describeWithEnvironment('RequestHeaderSection', () => { row.shadowRoot.querySelector('.header-value')?.textContent?.trim() || '', ]; }); - assert.deepStrictEqual(sorted, [ + assert.deepEqual(sorted, [ ['aa:', 'first'], ['ab:', 'second'], ['abc:', 'third'], diff --git a/front_end/panels/network/components/RequestHeadersView.test.ts b/front_end/panels/network/components/RequestHeadersView.test.ts index ed7e1bbd7e..ede9bd8100 100644 --- a/front_end/panels/network/components/RequestHeadersView.test.ts +++ b/front_end/panels/network/components/RequestHeadersView.test.ts @@ -170,13 +170,13 @@ describeWithMockConnection('RequestHeadersView', () => { const responseHeadersCategory = component.shadowRoot.querySelector('[aria-label="Response Headers"]'); assert.instanceOf(responseHeadersCategory, HTMLElement); - assert.deepStrictEqual( + assert.deepEqual( getRowsTextFromCategory(responseHeadersCategory), [['age:', '0'], ['cache-control:', 'max-age=600'], ['content-encoding:', 'gzip'], ['content-length:', '661']]); const requestHeadersCategory = component.shadowRoot.querySelector('[aria-label="Request Headers"]'); assert.instanceOf(requestHeadersCategory, HTMLElement); - assert.deepStrictEqual( + assert.deepEqual( getRowsTextFromCategory(requestHeadersCategory), [[':method:', 'GET'], ['accept-encoding:', 'gzip, deflate, br'], ['cache-control:', 'no-cache']]); }); @@ -187,7 +187,7 @@ describeWithMockConnection('RequestHeadersView', () => { const earlyHintsCategory = component.shadowRoot.querySelector('[aria-label="Early Hints Headers"]'); assert.instanceOf(earlyHintsCategory, HTMLElement); - assert.deepStrictEqual(getRowsTextFromCategory(earlyHintsCategory), [['link:', '']]); + assert.deepEqual(getRowsTextFromCategory(earlyHintsCategory), [['link:', '']]); }); it('emits UMA event when a header value is being copied', async () => { @@ -228,7 +228,7 @@ describeWithMockConnection('RequestHeadersView', () => { responseHeadersCategory.dispatchEvent(new NetworkComponents.RequestHeadersView.ToggleRawHeadersEvent()); await coordinator.done(); - assert.deepStrictEqual( + assert.deepEqual( getRowsTextFromCategory(responseHeadersCategory), [['age:', '0'], ['cache-control:', 'max-age=600'], ['content-encoding:', 'gzip'], ['content-length:', '661']]); }); @@ -285,12 +285,12 @@ describeWithMockConnection('RequestHeadersView', () => { const spy = sinon.spy(component, 'render'); assert.isTrue(spy.notCalled); - assert.deepStrictEqual(getRowsTextFromCategory(responseHeadersCategory), [['originalname:', 'originalValue']]); + assert.deepEqual(getRowsTextFromCategory(responseHeadersCategory), [['originalname:', 'originalValue']]); request.responseHeaders = [{name: 'updatedName', value: 'updatedValue'}]; assert.isTrue(spy.calledOnce); await coordinator.done(); - assert.deepStrictEqual(getRowsTextFromCategory(responseHeadersCategory), [['updatedname:', 'updatedValue']]); + assert.deepEqual(getRowsTextFromCategory(responseHeadersCategory), [['updatedname:', 'updatedValue']]); }); it('can highlight individual response headers', async () => { @@ -309,14 +309,14 @@ describeWithMockConnection('RequestHeadersView', () => { const responseHeadersCategory = component.shadowRoot.querySelector('[aria-label="Response Headers"]'); assert.instanceOf(responseHeadersCategory, HTMLElement); - assert.deepStrictEqual( + assert.deepEqual( getRowsTextFromCategory(responseHeadersCategory), [['devtools:', 'rock'], ['foo:', 'bar'], ['highlightme:', 'some value']]); - assert.deepStrictEqual(getRowHighlightStatus(responseHeadersCategory), [false, false, false]); + assert.deepEqual(getRowHighlightStatus(responseHeadersCategory), [false, false, false]); component.revealHeader(NetworkForward.UIRequestLocation.UIHeaderSection.RESPONSE, 'HiGhLiGhTmE'); await coordinator.done(); - assert.deepStrictEqual(getRowHighlightStatus(responseHeadersCategory), [false, false, true]); + assert.deepEqual(getRowHighlightStatus(responseHeadersCategory), [false, false, true]); }); it('can highlight individual request headers', async () => { @@ -335,14 +335,14 @@ describeWithMockConnection('RequestHeadersView', () => { const requestHeadersCategory = component.shadowRoot.querySelector('[aria-label="Request Headers"]'); assert.instanceOf(requestHeadersCategory, HTMLElement); - assert.deepStrictEqual( + assert.deepEqual( getRowsTextFromCategory(requestHeadersCategory), [['devtools:', 'rock'], ['foo:', 'bar'], ['highlightme:', 'some value']]); - assert.deepStrictEqual(getRowHighlightStatus(requestHeadersCategory), [false, false, false]); + assert.deepEqual(getRowHighlightStatus(requestHeadersCategory), [false, false, false]); component.revealHeader(NetworkForward.UIRequestLocation.UIHeaderSection.REQUEST, 'HiGhLiGhTmE'); await coordinator.done(); - assert.deepStrictEqual(getRowHighlightStatus(requestHeadersCategory), [false, false, true]); + assert.deepEqual(getRowHighlightStatus(requestHeadersCategory), [false, false, true]); }); it('renders a link to \'.headers\'', async () => { diff --git a/front_end/panels/network/components/RequestTrustTokensView.test.ts b/front_end/panels/network/components/RequestTrustTokensView.test.ts index f64292709f..ba6ceedc09 100644 --- a/front_end/panels/network/components/RequestTrustTokensView.test.ts +++ b/front_end/panels/network/components/RequestTrustTokensView.test.ts @@ -51,7 +51,7 @@ describeWithLocale('RequestTrustTokensView', () => { const issuerElements = getElementsWithinComponent(component, 'ul.issuers-list > li', HTMLElement); const actualIssuers = [...issuerElements].map(e => e.textContent); - assert.deepStrictEqual(actualIssuers.sort(), expectedIssuers.sort()); + assert.deepEqual(actualIssuers.sort(), expectedIssuers.sort()); }); it('renders a result section with success status for successful requests', () => { diff --git a/front_end/panels/protocol_monitor/ProtocolMonitor.test.ts b/front_end/panels/protocol_monitor/ProtocolMonitor.test.ts index 53676faa96..c7d4180cd5 100644 --- a/front_end/panels/protocol_monitor/ProtocolMonitor.test.ts +++ b/front_end/panels/protocol_monitor/ProtocolMonitor.test.ts @@ -12,19 +12,19 @@ describe('ProtocolMonitor', () => { parameters: {parameter1: 'value1'}, }; // "command" variations. - assert.deepStrictEqual( + assert.deepEqual( ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify({ command: input.command, parameters: input.parameters, })), input); - assert.deepStrictEqual( + assert.deepEqual( ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify({ cmd: input.command, parameters: input.parameters, })), input); - assert.deepStrictEqual( + assert.deepEqual( ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify({ method: input.command, parameters: input.parameters, @@ -32,19 +32,19 @@ describe('ProtocolMonitor', () => { input); // "parameters" variations. - assert.deepStrictEqual( + assert.deepEqual( ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify({ command: input.command, params: input.parameters, })), input); - assert.deepStrictEqual( + assert.deepEqual( ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify({ cmd: input.command, args: input.parameters, })), input); - assert.deepStrictEqual( + assert.deepEqual( ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify({ method: input.command, arguments: input.parameters, @@ -53,7 +53,7 @@ describe('ProtocolMonitor', () => { }); it('parses non-JSON data as a command name', async () => { - assert.deepStrictEqual(ProtocolMonitor.ProtocolMonitor.parseCommandInput('Input.dispatchMouseEvent'), { + assert.deepEqual(ProtocolMonitor.ProtocolMonitor.parseCommandInput('Input.dispatchMouseEvent'), { command: 'Input.dispatchMouseEvent', parameters: {}, }); @@ -130,14 +130,14 @@ describe('ProtocolMonitor', () => { }); const metadataByCommand = ProtocolMonitor.ProtocolMonitor.buildProtocolMetadata(domains); - assert.deepStrictEqual(metadataByCommand, expectedCommands); + assert.deepEqual(metadataByCommand, expectedCommands); }); }); describe('HistoryAutocompleteDataProvider', () => { it('should create completions with no history', async () => { const provider = new ProtocolMonitor.ProtocolMonitor.CommandAutocompleteSuggestionProvider(); - assert.deepStrictEqual(await provider.buildTextPromptCompletions('test', 'test'), []); + assert.deepEqual(await provider.buildTextPromptCompletions('test', 'test'), []); }); it('should build completions in the reverse insertion order', async () => { @@ -146,14 +146,14 @@ describe('ProtocolMonitor', () => { provider.addEntry('test1'); provider.addEntry('test2'); provider.addEntry('test3'); - assert.deepStrictEqual(await provider.buildTextPromptCompletions('test', 'test'), [ + assert.deepEqual(await provider.buildTextPromptCompletions('test', 'test'), [ {text: 'test3'}, {text: 'test2'}, {text: 'test1'}, ]); provider.addEntry('test1'); - assert.deepStrictEqual(await provider.buildTextPromptCompletions('test', 'test'), [ + assert.deepEqual(await provider.buildTextPromptCompletions('test', 'test'), [ {text: 'test1'}, {text: 'test3'}, {text: 'test2'}, @@ -167,7 +167,7 @@ describe('ProtocolMonitor', () => { provider.addEntry('test2'); provider.addEntry('test3'); - assert.deepStrictEqual(await provider.buildTextPromptCompletions('test', 'test'), [ + assert.deepEqual(await provider.buildTextPromptCompletions('test', 'test'), [ {text: 'test3'}, {text: 'test2'}, ]); diff --git a/front_end/panels/protocol_monitor/components/JSONEditor.test.ts b/front_end/panels/protocol_monitor/components/JSONEditor.test.ts index 2624493d6a..e5da6fc866 100644 --- a/front_end/panels/protocol_monitor/components/JSONEditor.test.ts +++ b/front_end/panels/protocol_monitor/components/JSONEditor.test.ts @@ -369,7 +369,7 @@ describeWithEnvironment('JSONEditor', () => { const parameterRecorderInput = inputs[1]; const value = parameterRecorderInput.renderRoot.textContent?.replaceAll(/\s/g, ''); const expectedValue = 'test'; - assert.deepStrictEqual(value, expectedValue); + assert.deepEqual(value, expectedValue); }); it('should show the command written in the input bar inside the editor when parameters are arrays with the correct value', @@ -385,7 +385,7 @@ describeWithEnvironment('JSONEditor', () => { const parameterRecorderInput = inputs[1]; const value = parameterRecorderInput.renderRoot.textContent?.replaceAll(/\s/g, ''); const expectedValue = 'test'; - assert.deepStrictEqual(value, expectedValue); + assert.deepEqual(value, expectedValue); }); it('should show the command written in the input bar inside the editor when parameters are object with the correct value', @@ -405,7 +405,7 @@ describeWithEnvironment('JSONEditor', () => { const parameterRecorderInput = inputs[1]; const value = parameterRecorderInput.renderRoot.textContent?.replaceAll(/\s/g, ''); const expectedValue = 'test1'; - assert.deepStrictEqual(value, expectedValue); + assert.deepEqual(value, expectedValue); }); it('should should every parameter of a command as undefined even if some parameters have not been entered inside the input bar', @@ -428,7 +428,7 @@ describeWithEnvironment('JSONEditor', () => { const shadowRoot = jsonEditor.renderRoot; const displayedParameters = shadowRoot.querySelectorAll('.parameter'); // Two parameters (test and test2) should be displayed because in the metadata, Test.test5 accepts two parameters - assert.deepStrictEqual(displayedParameters.length, 2); + assert.deepEqual(displayedParameters.length, 2); }); it('does not output parameters if the input is invalid json', async () => { const cdpCommand = '"command": "Test.test", "parameters":'; @@ -436,7 +436,7 @@ describeWithEnvironment('JSONEditor', () => { const {inputs} = await renderEditorForCommand(command, parameters); - assert.deepStrictEqual(inputs.length, Object.keys(parameters).length + 1); + assert.deepEqual(inputs.length, Object.keys(parameters).length + 1); }); it('does not output parameters if the parameters field is not an object', async () => { @@ -446,7 +446,7 @@ describeWithEnvironment('JSONEditor', () => { const {inputs} = await renderEditorForCommand(command, parameters); - assert.deepStrictEqual(inputs.length, Object.keys(parameters).length + 1); + assert.deepEqual(inputs.length, Object.keys(parameters).length + 1); }); it('does not output parameters if there is no parameter inserted in the input bar', async () => { @@ -456,7 +456,7 @@ describeWithEnvironment('JSONEditor', () => { const {inputs} = await renderEditorForCommand(command, parameters); - assert.deepStrictEqual(inputs.length, Object.keys(parameters).length + 1); + assert.deepEqual(inputs.length, Object.keys(parameters).length + 1); }); it('checks that the command input field remains empty when there is no command parameter entered', async () => { @@ -470,7 +470,7 @@ describeWithEnvironment('JSONEditor', () => { const {displayedCommand} = await renderEditorForCommand(command, parameters); - assert.deepStrictEqual(displayedCommand, ''); + assert.deepEqual(displayedCommand, ''); }); it('checks that the command input field remains if the command is not supported', async () => { @@ -479,7 +479,7 @@ describeWithEnvironment('JSONEditor', () => { const {command, parameters} = ProtocolMonitor.ProtocolMonitor.parseCommandInput(JSON.stringify(cdpCommand)); const {displayedCommand} = await renderEditorForCommand(command, parameters); - assert.deepStrictEqual(displayedCommand, ''); + assert.deepEqual(displayedCommand, ''); }); }); @@ -507,7 +507,7 @@ describeWithEnvironment('JSONEditor', () => { // The first input bar corresponds to the filter bar, so we query the second one which corresponds to the CDP one. const toolbarInput = dataGrid.element.shadowRoot?.querySelectorAll('.toolbar')[1].shadowRoot?.querySelector( '.toolbar-input-prompt'); - assert.deepStrictEqual(toolbarInput?.innerHTML, '{"command":"Test.test","parameters":{"test":"test"}}'); + assert.deepEqual(toolbarInput?.innerHTML, '{"command":"Test.test","parameters":{"test":"test"}}'); }); it('should update the selected target inside the input bar', async () => { @@ -529,7 +529,7 @@ describeWithEnvironment('JSONEditor', () => { await coordinator.done(); // Should be index 1 because the targetId equals "value2" which corresponds to the index number 1 - assert.deepStrictEqual(selector.selectedIndex(), 1); + assert.deepEqual(selector.selectedIndex(), 1); }); // Flaky test. @@ -550,7 +550,7 @@ describeWithEnvironment('JSONEditor', () => { // The first input bar corresponds to the filter bar, so we query the second one which corresponds to the CDP one. const toolbarInput = dataGrid.element.shadowRoot?.querySelectorAll('.toolbar')[1].shadowRoot?.querySelector( '.toolbar-input-prompt'); - assert.deepStrictEqual(toolbarInput?.innerHTML, ''); + assert.deepEqual(toolbarInput?.innerHTML, ''); }); }); describe('Descriptions', () => { @@ -578,7 +578,7 @@ describeWithEnvironment('JSONEditor', () => { await renderHoveredElement(param); const popupContent = serializePopupContent(); const expectedPopupContent = 'test.Type:arrayLearnMore'; - assert.deepStrictEqual(popupContent, expectedPopupContent); + assert.deepEqual(popupContent, expectedPopupContent); }); it('should show the popup with the correct description for the description of command', async () => { @@ -595,7 +595,7 @@ describeWithEnvironment('JSONEditor', () => { const popupContent = serializePopupContent(); const expectedPopupContent = 'Description1.Returns:Test1LearnMore'; - assert.deepStrictEqual(popupContent, expectedPopupContent); + assert.deepEqual(popupContent, expectedPopupContent); }); }); @@ -611,7 +611,7 @@ describeWithEnvironment('JSONEditor', () => { await populateMetadata(jsonEditor); const suggestions = await renderSuggestionBox(command, jsonEditor, enumsByName); - assert.deepStrictEqual(suggestions, ['test', 'test1', 'test2']); + assert.deepEqual(suggestions, ['test', 'test1', 'test2']); }); it('should display suggestion box with correct suggestions when the parameter is a boolean', async () => { @@ -623,7 +623,7 @@ describeWithEnvironment('JSONEditor', () => { const suggestions = await renderSuggestionBox(command, jsonEditor); - assert.deepStrictEqual(suggestions, ['false', 'true']); + assert.deepEqual(suggestions, ['false', 'true']); }); it('should show the suggestion box for enum parameters nested inside arrays', async () => { @@ -675,7 +675,7 @@ describeWithEnvironment('JSONEditor', () => { return (item.textContent.replaceAll(/\s/g, '')); }); - assert.deepStrictEqual(suggestions, ['test', 'test1', 'test2']); + assert.deepEqual(suggestions, ['test', 'test1', 'test2']); }); it('should update the values inside the suggestion box when the command changes', async () => { @@ -695,7 +695,7 @@ describeWithEnvironment('JSONEditor', () => { const newSuggestions = await renderSuggestionBox(newCommand, jsonEditor, enumsByName); - assert.deepStrictEqual(newSuggestions, ['newtest', 'newtest1', 'newtest2']); + assert.deepEqual(newSuggestions, ['newtest', 'newtest1', 'newtest2']); }); it('should not display suggestion box when the parameter is neither a string or a boolean', async () => { @@ -707,7 +707,7 @@ describeWithEnvironment('JSONEditor', () => { const suggestions = await renderSuggestionBox(command, jsonEditor); - assert.deepStrictEqual(suggestions, []); + assert.deepEqual(suggestions, []); }); }); @@ -720,7 +720,7 @@ describeWithEnvironment('JSONEditor', () => { const expectedPlaceholder = ''; - assert.deepStrictEqual(placeholder, expectedPlaceholder); + assert.deepEqual(placeholder, expectedPlaceholder); }); it('should show 0 as a value inside input when clicking on plus button for optional number parameter', async () => { @@ -730,7 +730,7 @@ describeWithEnvironment('JSONEditor', () => { const expectedValue = 0; - assert.deepStrictEqual(value, expectedValue); + assert.deepEqual(value, expectedValue); }); it('should show false as a value inside input when clicking on plus button for optional boolean parameter', @@ -741,7 +741,7 @@ describeWithEnvironment('JSONEditor', () => { const expectedValue = false; - assert.deepStrictEqual(value, expectedValue); + assert.deepEqual(value, expectedValue); }); it('should show the keys with default values when clicking of plus button for optional object parameters', @@ -786,7 +786,7 @@ describeWithEnvironment('JSONEditor', () => { // The -1 is need to not take into account the input for the command const numberOfInputs = jsonEditor.renderRoot.querySelectorAll('devtools-suggestion-input').length - 1; - assert.deepStrictEqual(numberOfInputs, 2); + assert.deepEqual(numberOfInputs, 2); }); }); @@ -827,7 +827,7 @@ describeWithEnvironment('JSONEditor', () => { const expectedValues = ['', '']; - assert.deepStrictEqual(values, expectedValues); + assert.deepEqual(values, expectedValues); }); it('should reset the value of array parameter to empty array when clicking on clear button', async () => { @@ -868,7 +868,7 @@ describeWithEnvironment('JSONEditor', () => { const value = jsonEditor.parameters[0].value; - assert.deepStrictEqual(value, []); + assert.deepEqual(value, []); }); it('should reset the value of optional object parameter to undefined after clicking on clear button', async () => { @@ -924,7 +924,7 @@ describeWithEnvironment('JSONEditor', () => { // The -1 is need to not take into account the input for the command const numberOfInputs = jsonEditor.renderRoot.querySelectorAll('devtools-suggestion-input').length - 1; - assert.deepStrictEqual(numberOfInputs, 0); + assert.deepEqual(numberOfInputs, 0); }); }); @@ -962,7 +962,7 @@ describeWithEnvironment('JSONEditor', () => { } const resultedParams = jsonEditor.getParameters(); - assert.deepStrictEqual(expectedParams, resultedParams); + assert.deepEqual(expectedParams, resultedParams); }); it('should add parameters when clicking on "Plus" button for array parameters', async () => { @@ -996,7 +996,7 @@ describeWithEnvironment('JSONEditor', () => { // The -1 is need to not take into account the input for the command const numberOfInputs = jsonEditor.renderRoot.querySelectorAll('devtools-suggestion-input').length - 1; - assert.deepStrictEqual(numberOfInputs, 2); + assert.deepEqual(numberOfInputs, 2); }); }); @@ -1082,7 +1082,7 @@ describeWithEnvironment('JSONEditor', () => { const response = await responsePromise as ProtocolComponents.JSONEditor.SubmitEditorEvent; - assert.deepStrictEqual(response.data.parameters, expectedParameters); + assert.deepEqual(response.data.parameters, expectedParameters); }); it('should return the parameters in a format understandable by the ProtocolMonitor when sending a command via the send button', @@ -1114,7 +1114,7 @@ describeWithEnvironment('JSONEditor', () => { testName: 'testValue', }; - assert.deepStrictEqual(response.data.parameters, expectedParameters); + assert.deepEqual(response.data.parameters, expectedParameters); }); }); @@ -1153,8 +1153,8 @@ describeWithEnvironment('JSONEditor', () => { const inputs = jsonEditor.renderRoot.querySelectorAll('devtools-suggestion-input'); const addButtons = jsonEditor.renderRoot.querySelectorAll('devtools-button[title="Add a parameter"]'); - assert.deepStrictEqual(inputs.length, 1); - assert.deepStrictEqual(addButtons.length, 0); + assert.deepEqual(inputs.length, 1); + assert.deepEqual(addButtons.length, 0); }); it('checks that the selection of a target works', async () => { @@ -1168,7 +1168,7 @@ describeWithEnvironment('JSONEditor', () => { selectMenu?.dispatchEvent(event); const expectedId = jsonEditor.targetId; - assert.deepStrictEqual(targetId, expectedId); + assert.deepEqual(targetId, expectedId); }); it('should copy the CDP command to clipboard via copy event', async () => { @@ -1254,7 +1254,7 @@ describeWithEnvironment('JSONEditor', () => { const parameters = shadowRoot.querySelectorAll('.parameter'); // This expected value is equal to 6 because there are 5 different parameters inside typesByName + 1 // for the name of the parameter (traceConfig) - assert.deepStrictEqual(parameters.length, 6); + assert.deepEqual(parameters.length, 6); }); it('should return the parameters in a format understandable by the ProtocolMonitor when sending a command with object parameter that has no typeRef found in map', @@ -1343,7 +1343,7 @@ describeWithEnvironment('JSONEditor', () => { }, }; - assert.deepStrictEqual(response.data.parameters, expectedParameters); + assert.deepEqual(response.data.parameters, expectedParameters); }); it('should show the custom editor for an object param that has no type ref', async () => { @@ -1378,7 +1378,7 @@ describeWithEnvironment('JSONEditor', () => { const numberOfInputs = jsonEditor.renderRoot.querySelectorAll('devtools-suggestion-input').length - 1; - assert.deepStrictEqual(numberOfInputs, 4); + assert.deepEqual(numberOfInputs, 4); }); describe('Command suggestion filter', () => { diff --git a/front_end/panels/recorder/RecorderController.test.ts b/front_end/panels/recorder/RecorderController.test.ts index f173cdd167..050edb3d58 100644 --- a/front_end/panels/recorder/RecorderController.test.ts +++ b/front_end/panels/recorder/RecorderController.test.ts @@ -100,7 +100,7 @@ describeWithEnvironment('RecorderController', () => { ); const flow = controller.getUserFlow(); - assert.deepStrictEqual(flow, { + assert.deepEqual(flow, { title: 'test', steps: [ { @@ -133,7 +133,7 @@ describeWithEnvironment('RecorderController', () => { ); const flow = controller.getUserFlow(); - assert.deepStrictEqual(flow, { + assert.deepEqual(flow, { title: 'test', steps: [ { @@ -161,7 +161,7 @@ describeWithEnvironment('RecorderController', () => { ); const flow = controller.getUserFlow(); - assert.deepStrictEqual(flow, { + assert.deepEqual(flow, { title: 'test', steps: [ { @@ -186,7 +186,7 @@ describeWithEnvironment('RecorderController', () => { ); const flow = controller.getUserFlow(); - assert.deepStrictEqual(flow, {title: 'test', steps: []}); + assert.deepEqual(flow, {title: 'test', steps: []}); }); it('should adding a new step before a step with a breakpoint update the breakpoint indexes correctly', async () => { diff --git a/front_end/panels/recorder/components/CreateRecordingView.test.ts b/front_end/panels/recorder/components/CreateRecordingView.test.ts index b0aa425801..c3d764bf60 100644 --- a/front_end/panels/recorder/components/CreateRecordingView.test.ts +++ b/front_end/panels/recorder/components/CreateRecordingView.test.ts @@ -120,7 +120,7 @@ describeWithEnvironment('CreateRecordingView', () => { button.dispatchEvent(new Event('click')); const event = await onceClicked; - assert.deepStrictEqual(event.selectorTypesToRecord, [ + assert.deepEqual(event.selectorTypesToRecord, [ 'aria', 'text', 'xpath', diff --git a/front_end/panels/recorder/components/RecordingView.test.ts b/front_end/panels/recorder/components/RecordingView.test.ts index f1623415f2..b3cfc54529 100644 --- a/front_end/panels/recorder/components/RecordingView.test.ts +++ b/front_end/panels/recorder/components/RecordingView.test.ts @@ -135,13 +135,13 @@ describeWithEnvironment('RecordingView', () => { // Click is handled async, therefore, waiting for the text editor. const textEditor = await waitForTextEditor(view); - assert.deepStrictEqual(textEditor.editor.state.selection.toJSON(), { + assert.deepEqual(textEditor.editor.state.selection.toJSON(), { ranges: [{anchor: 0, head: 0}], main: 0, }); hoverOverScrollStep(view); - assert.deepStrictEqual(textEditor.editor.state.selection.toJSON(), { + assert.deepEqual(textEditor.editor.state.selection.toJSON(), { ranges: [{anchor: 34, head: 68}], main: 0, }); diff --git a/front_end/panels/recorder/components/StepEditor.test.ts b/front_end/panels/recorder/components/StepEditor.test.ts index 4f6e273495..8d5d3e0ea3 100644 --- a/front_end/panels/recorder/components/StepEditor.test.ts +++ b/front_end/panels/recorder/components/StepEditor.test.ts @@ -164,12 +164,12 @@ describeWithLocale('StepEditor', () => { ); await editor.updateComplete; - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Change, selectors: ['.cls'], value: 'Value', }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'change', '.cls', 'Value', @@ -202,13 +202,13 @@ describeWithLocale('StepEditor', () => { ); await editor.updateComplete; - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Click, selectors: ['.cls'], offsetX: 1, offsetY: 1, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'click', '.cls', '1', @@ -238,12 +238,12 @@ describeWithLocale('StepEditor', () => { ); await editor.updateComplete; - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.CustomStep, name: 'test', parameters: {custom: 'test'}, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'customStep', 'test', '{"custom":"test"}', @@ -315,11 +315,11 @@ describeWithLocale('StepEditor', () => { await addOptionalField(editor, 'x'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, x: 0, }); - assert.deepStrictEqual(getAllInputValues(editor), ['scroll', '0']); + assert.deepEqual(getAllInputValues(editor), ['scroll', '0']); }); it('should add the duration field', async () => { @@ -333,14 +333,14 @@ describeWithLocale('StepEditor', () => { await addOptionalField(editor, 'duration'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Click, offsetX: 1, offsetY: 1, selectors: ['.cls'], duration: 50, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'click', '.cls', '1', @@ -358,12 +358,12 @@ describeWithLocale('StepEditor', () => { await addOptionalField(editor, 'properties'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.WaitForElement, selectors: ['.cls'], properties: {}, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'waitForElement', '.cls', '{}', @@ -379,12 +379,12 @@ describeWithLocale('StepEditor', () => { await addOptionalField(editor, 'timeout'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Navigate, url: 'https://example.com', timeout: 5000, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'navigate', 'https://example.com', '5000', @@ -400,8 +400,8 @@ describeWithLocale('StepEditor', () => { await deleteOptionalField(editor, 'x'); - assert.deepStrictEqual(await step, {type: Models.Schema.StepType.Scroll}); - assert.deepStrictEqual(getAllInputValues(editor), ['scroll']); + assert.deepEqual(await step, {type: Models.Schema.StepType.Scroll}); + assert.deepEqual(getAllInputValues(editor), ['scroll']); }); it('should add/remove frames', async () => { @@ -414,11 +414,11 @@ describeWithLocale('StepEditor', () => { await clickFrameLevelButton(editor, '.add-frame'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, frame: [0, 0], }); - assert.deepStrictEqual(getAllInputValues(editor), ['scroll', '0', '0']); + assert.deepEqual(getAllInputValues(editor), ['scroll', '0', '0']); assert.isTrue( editor.shadowRoot?.activeElement?.matches( @@ -431,11 +431,11 @@ describeWithLocale('StepEditor', () => { await clickFrameLevelButton(editor, '.remove-frame'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, frame: [0], }); - assert.deepStrictEqual(getAllInputValues(editor), ['scroll', '0']); + assert.deepEqual(getAllInputValues(editor), ['scroll', '0']); assert.isTrue( editor.shadowRoot?.activeElement?.matches( @@ -456,11 +456,11 @@ describeWithLocale('StepEditor', () => { await clickSelectorLevelButton(editor, [0, 0], '.add-selector-part'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, selectors: [['.part1', '.cls']], }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'scroll', '.part1', '.cls', @@ -478,11 +478,11 @@ describeWithLocale('StepEditor', () => { await clickSelectorLevelButton(editor, [0, 0], '.remove-selector-part'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, selectors: ['.cls'], }); - assert.deepStrictEqual(getAllInputValues(editor), ['scroll', '.cls']); + assert.deepEqual(getAllInputValues(editor), ['scroll', '.cls']); assert.isTrue( editor.shadowRoot?.activeElement?.matches( @@ -502,11 +502,11 @@ describeWithLocale('StepEditor', () => { await clickSelectorLevelButton(editor, [0], '.add-selector'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, selectors: ['.part1', '.cls'], }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'scroll', '.part1', '.cls', @@ -522,11 +522,11 @@ describeWithLocale('StepEditor', () => { await clickSelectorLevelButton(editor, [1], '.remove-selector'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Scroll, selectors: ['.part1'], }); - assert.deepStrictEqual(getAllInputValues(editor), ['scroll', '.part1']); + assert.deepEqual(getAllInputValues(editor), ['scroll', '.part1']); assert.isTrue( editor.shadowRoot?.activeElement?.matches( 'devtools-suggestion-input[data-path="selectors.0.0"]', @@ -579,12 +579,12 @@ describeWithLocale('StepEditor', () => { const step = getStepEditedPromise(editor); await addOptionalField(editor, 'count'); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.WaitForElement, selectors: ['.cls'], count: 1, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'waitForElement', '.cls', '1', @@ -618,7 +618,7 @@ describeWithLocale('StepEditor', () => { ); await editor.updateComplete; - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.Navigate, url: 'www.example.com', assertedEvents: [{ @@ -642,12 +642,12 @@ describeWithLocale('StepEditor', () => { editor.renderRoot.querySelectorAll('.add-attribute-assertion')[0]?.click(); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.WaitForElement, selectors: ['.part1'], attributes: {a: 'b', attribute: 'value'}, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'waitForElement', '.part1', 'a', @@ -661,12 +661,12 @@ describeWithLocale('StepEditor', () => { editor.renderRoot.querySelectorAll('.remove-attribute-assertion')[1]?.click(); - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.WaitForElement, selectors: ['.part1'], attributes: {a: 'b'}, }); - assert.deepStrictEqual(getAllInputValues(editor), [ + assert.deepEqual(getAllInputValues(editor), [ 'waitForElement', '.part1', 'a', @@ -700,7 +700,7 @@ describeWithLocale('StepEditor', () => { ); await editor.updateComplete; - assert.deepStrictEqual(await step, { + assert.deepEqual(await step, { type: Models.Schema.StepType.WaitForElement, selectors: ['.part1'], attributes: { diff --git a/front_end/panels/recorder/components/StepView.test.ts b/front_end/panels/recorder/components/StepView.test.ts index bcca5bc0eb..9dcf15f162 100644 --- a/front_end/panels/recorder/components/StepView.test.ts +++ b/front_end/panels/recorder/components/StepView.test.ts @@ -63,7 +63,7 @@ describeWithEnvironment('StepView', () => { it('should produce actions for a step', async () => { const {viewFunction, getViewInput} = createViewFunctionSpy(); await createStepView(viewFunction, {step}); - assert.deepStrictEqual(getViewInput().actions, [ + assert.deepEqual(getViewInput().actions, [ {id: 'add-step-before', label: 'Add step before', group: 'stepManagement', groupTitle: 'Manage steps'}, {id: 'add-step-after', label: 'Add step after', group: 'stepManagement', groupTitle: 'Manage steps'}, { @@ -79,7 +79,7 @@ describeWithEnvironment('StepView', () => { it('should produce actions for a section', async () => { const {viewFunction, getViewInput} = createViewFunctionSpy(); await createStepView(viewFunction, {section}); - assert.deepStrictEqual(getViewInput().actions, [ + assert.deepEqual(getViewInput().actions, [ {id: 'add-step-after', label: 'Add step after', group: 'stepManagement', groupTitle: 'Manage steps'}, ]); }); @@ -95,7 +95,7 @@ describeWithEnvironment('StepView', () => { const event = await eventPromise; assert.strictEqual(event.position, 'before'); - assert.deepStrictEqual(event.stepOrSection, step); + assert.deepEqual(event.stepOrSection, step); }); it('should dispatch "AddStep before" events on sections', async () => { @@ -110,7 +110,7 @@ describeWithEnvironment('StepView', () => { const event = await eventPromise; assert.strictEqual(event.position, 'before'); - assert.deepStrictEqual(event.stepOrSection, section); + assert.deepEqual(event.stepOrSection, section); }); it('should dispatch "AddStep after" events on steps', async () => { @@ -125,7 +125,7 @@ describeWithEnvironment('StepView', () => { const event = await eventPromise; assert.strictEqual(event.position, 'after'); - assert.deepStrictEqual(event.stepOrSection, step); + assert.deepEqual(event.stepOrSection, step); }); it('should dispatch "Remove steps" events on steps', async () => { @@ -139,7 +139,7 @@ describeWithEnvironment('StepView', () => { getViewInput().handleStepAction(new Menus.Menu.MenuItemSelectedEvent('remove-step')); const event = await eventPromise; - assert.deepStrictEqual(event.step, step); + assert.deepEqual(event.step, step); }); it('should dispatch "Add breakpoint" event on steps', async () => { @@ -153,7 +153,7 @@ describeWithEnvironment('StepView', () => { getViewInput().handleStepAction(new Menus.Menu.MenuItemSelectedEvent('add-breakpoint')); const event = await eventPromise; - assert.deepStrictEqual(event.index, 0); + assert.deepEqual(event.index, 0); }); it('should dispatch "Remove breakpoint" event on steps', async () => { @@ -167,7 +167,7 @@ describeWithEnvironment('StepView', () => { getViewInput().handleStepAction(new Menus.Menu.MenuItemSelectedEvent('remove-breakpoint')); const event = await eventPromise; - assert.deepStrictEqual(event.index, 0); + assert.deepEqual(event.index, 0); }); it('should dispatch copy step as JSON events', async () => { @@ -197,7 +197,7 @@ describeWithEnvironment('StepView', () => { getViewInput().onBreakpointClick(); const event = await eventPromise; - assert.deepStrictEqual(event.index, 0); + assert.deepEqual(event.index, 0); }); it('should dispatch "Remove breakpoint" event on breakpoint icon click if there already is a breakpoint on the step', @@ -212,7 +212,7 @@ describeWithEnvironment('StepView', () => { getViewInput().onBreakpointClick(); const event = await eventPromise; - assert.deepStrictEqual(event.index, 0); + assert.deepEqual(event.index, 0); }); }); }); diff --git a/front_end/panels/recorder/converters/LighthouseConverter.test.ts b/front_end/panels/recorder/converters/LighthouseConverter.test.ts index afd337f421..2e4d4235ed 100644 --- a/front_end/panels/recorder/converters/LighthouseConverter.test.ts +++ b/front_end/panels/recorder/converters/LighthouseConverter.test.ts @@ -57,7 +57,7 @@ const puppeteer = require('puppeteer'); // v23.0.0 or later await browser.close();`; const actual = result.substring(0, expected.length); assert.strictEqual(actual, expected, `Unexpected start of generated result:\n${actual}`); - assert.deepStrictEqual(sourceMap, [1, 17, 6, 23, 9]); + assert.deepEqual(sourceMap, [1, 17, 6, 23, 9]); }); it('should stringify a step', async () => { diff --git a/front_end/panels/recorder/converters/PuppeteerConverter.test.ts b/front_end/panels/recorder/converters/PuppeteerConverter.test.ts index d509524d2b..aafdf04055 100644 --- a/front_end/panels/recorder/converters/PuppeteerConverter.test.ts +++ b/front_end/panels/recorder/converters/PuppeteerConverter.test.ts @@ -35,7 +35,7 @@ describe('PuppeteerConverter', () => { await browser.close();`; const actual = result.substring(0, expected.length); assert.strictEqual(actual, expected, `Unexpected start of generated result:\n${actual}`); - assert.deepStrictEqual(sourceMap, [1, 8, 8]); + assert.deepEqual(sourceMap, [1, 8, 8]); }); it('should stringify a step', async () => { @@ -83,6 +83,6 @@ describe('PuppeteerConverter', () => { await browser.close();`; const actual = result.substring(0, expected.length); assert.strictEqual(actual, expected, `Unexpected start of generated result:\n${actual}`); - assert.deepStrictEqual(sourceMap, [1, 8, 8]); + assert.deepEqual(sourceMap, [1, 8, 8]); }); }); diff --git a/front_end/panels/recorder/converters/PuppeteerReplayConverter.test.ts b/front_end/panels/recorder/converters/PuppeteerReplayConverter.test.ts index d7cd9f8831..d8b3c6772f 100644 --- a/front_end/panels/recorder/converters/PuppeteerReplayConverter.test.ts +++ b/front_end/panels/recorder/converters/PuppeteerReplayConverter.test.ts @@ -40,7 +40,7 @@ if (process && import.meta.url === url.pathToFileURL(process.argv[1]).href) { } `, ); - assert.deepStrictEqual(sourceMap, [1, 8, 8]); + assert.deepEqual(sourceMap, [1, 8, 8]); }); it('should stringify a step', async () => { diff --git a/front_end/panels/recorder/models/ScreenshotUtils.test.ts b/front_end/panels/recorder/models/ScreenshotUtils.test.ts index 7170100b79..373e2c0fe1 100644 --- a/front_end/panels/recorder/models/ScreenshotUtils.test.ts +++ b/front_end/panels/recorder/models/ScreenshotUtils.test.ts @@ -46,25 +46,25 @@ describe('ScreenshotUtils', () => { it('can resize screenshots to be 160px wide and <= 240px high', async () => { const {resizeScreenshot} = Models.ScreenshotUtils; - assert.deepStrictEqual( + assert.deepEqual( await getScreenshotDimensions( await resizeScreenshot(await generateImage(400, 800)), ), [160, 240], ); - assert.deepStrictEqual( + assert.deepEqual( await getScreenshotDimensions( await resizeScreenshot(await generateImage(800, 400)), ), [160, 80], ); - assert.deepStrictEqual( + assert.deepEqual( await getScreenshotDimensions( await resizeScreenshot(await generateImage(80, 80)), ), [160, 160], ); - assert.deepStrictEqual( + assert.deepEqual( await getScreenshotDimensions( await resizeScreenshot(await generateImage(80, 320)), ), diff --git a/front_end/panels/recorder/models/Section.test.ts b/front_end/panels/recorder/models/Section.test.ts index bc6818e272..46b869e598 100644 --- a/front_end/panels/recorder/models/Section.test.ts +++ b/front_end/panels/recorder/models/Section.test.ts @@ -40,13 +40,13 @@ describe('Section', () => { } it('should build not sections for empty steps', () => { - assert.deepStrictEqual(buildSections([]), []); + assert.deepEqual(buildSections([]), []); }); it('should build a current page section for initial steps that do not cause navigation', () => { const step1 = makeStep(); const step2 = makeStep(); - assert.deepStrictEqual(buildSections([step1, step2]), [ + assert.deepEqual(buildSections([step1, step2]), [ {title: 'Current page', url: '', steps: [step1, step2]}, ]); }); @@ -55,7 +55,7 @@ describe('Section', () => { { const step1 = makeNavigateStep(); const step2 = makeStep(); - assert.deepStrictEqual(buildSections([step1, step2]), [ + assert.deepEqual(buildSections([step1, step2]), [ { title: 'Test', url: 'https://example.com', @@ -65,7 +65,7 @@ describe('Section', () => { ]); } - {const step1 = makeStepCausingNavigation(); const step2 = makeStep(); assert.deepStrictEqual( + {const step1 = makeStepCausingNavigation(); const step2 = makeStep(); assert.deepEqual( buildSections([step1, step2]), [ {title: 'Current page', url: '', steps: [step1]}, @@ -80,7 +80,7 @@ describe('Section', () => { const step4 = makeStepCausingNavigation(); const step5 = makeStep(); - assert.deepStrictEqual( + assert.deepEqual( buildSections([step1, step2, step3, step4, step5]), [ {title: 'Current page', url: '', steps: [step1, step2]}, diff --git a/front_end/panels/settings/emulation/utils/StructuredHeaders.test.ts b/front_end/panels/settings/emulation/utils/StructuredHeaders.test.ts index 4a02d2fb64..21e66d0f81 100644 --- a/front_end/panels/settings/emulation/utils/StructuredHeaders.test.ts +++ b/front_end/panels/settings/emulation/utils/StructuredHeaders.test.ts @@ -55,7 +55,7 @@ function assertParams( assert.lengthOf(result.items, expectParams.length); for (let i = 0; i < expectParams.length; ++i) { assert.strictEqual(result.items[i].name.value, expectParams[i][0]); - assert.deepStrictEqual(result.items[i].value, expectParams[i][1], 'Param ' + i + ' value mismatch'); + assert.deepEqual(result.items[i].value, expectParams[i][1], 'Param ' + i + ' value mismatch'); } } @@ -88,7 +88,7 @@ function assertListItem( assert.fail('Unexpected inner list when an item expected'); return; } - assert.deepStrictEqual( + assert.deepEqual( item.value, expectValue, 'List item bare value mismatch, ' + item.value.value + ' vs expected ' + expectValue.value); assertItemParams(item, expectParams); diff --git a/front_end/panels/sources/CSSPlugin.test.ts b/front_end/panels/sources/CSSPlugin.test.ts index 06fa2caa9e..1403dfcb4c 100644 --- a/front_end/panels/sources/CSSPlugin.test.ts +++ b/front_end/panels/sources/CSSPlugin.test.ts @@ -77,7 +77,7 @@ describeWithMockConnection('CSSPlugin', () => { sinon.stub(SDK.CSSModel.CSSModel.prototype, 'getClassNames').withArgs(STYLESHEET_ID).resolves(CLASS_NAMES); const completionResult = await autocompletion!({state: {field: () => {}}} as unknown as CodeMirror.CompletionContext); - assert.deepStrictEqual(completionResult, { + assert.deepEqual(completionResult, { from: FROM, options: [ {type: 'constant', label: CLASS_NAMES[0]}, diff --git a/front_end/panels/timeline/EntriesFilter.test.ts b/front_end/panels/timeline/EntriesFilter.test.ts index 05e98bdf68..b7d1c68fe8 100644 --- a/front_end/panels/timeline/EntriesFilter.test.ts +++ b/front_end/panels/timeline/EntriesFilter.test.ts @@ -742,7 +742,7 @@ describeWithEnvironment('EntriesFilter', function() { // delete for smaller deepStrictEqual comparison simpleFooNode.children = []; - assert.deepStrictEqual(simpleFooNode, { + assert.deepEqual(simpleFooNode, { dur: 0.2, name: 'foo', selected: true, diff --git a/front_end/panels/timeline/components/BreadcrumbsUI.test.ts b/front_end/panels/timeline/components/BreadcrumbsUI.test.ts index c6694c31ec..eb4eec5aaf 100644 --- a/front_end/panels/timeline/components/BreadcrumbsUI.test.ts +++ b/front_end/panels/timeline/components/BreadcrumbsUI.test.ts @@ -56,8 +56,8 @@ describeWithEnvironment('BreadcrumbsUI', () => { const breadcrumbsRanges = queryBreadcrumbs(component); - assert.deepStrictEqual(breadcrumbsRanges.length, 1); - assert.deepStrictEqual(breadcrumbsRanges, ['Full range (9.00 ms)']); + assert.deepEqual(breadcrumbsRanges.length, 1); + assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)']); }); it('renders all the breadcrumbs provided', async () => { @@ -93,11 +93,11 @@ describeWithEnvironment('BreadcrumbsUI', () => { const breadcrumbsRanges = queryBreadcrumbs(component); - assert.deepStrictEqual(breadcrumbsRanges.length, 2); - assert.deepStrictEqual(breadcrumbsRanges, ['Full range (9.00 ms)', '7.00 ms']); + assert.deepEqual(breadcrumbsRanges.length, 2); + assert.deepEqual(breadcrumbsRanges, ['Full range (9.00 ms)', '7.00 ms']); // There should always be one active breadcrumb const activeRange = queryActiveBreadcrumb(component); - assert.deepStrictEqual(activeRange.length, 1); + assert.deepEqual(activeRange.length, 1); }); }); diff --git a/front_end/panels/timeline/components/IgnoreListSetting.test.ts b/front_end/panels/timeline/components/IgnoreListSetting.test.ts index a6848b2d6d..86586ce600 100644 --- a/front_end/panels/timeline/components/IgnoreListSetting.test.ts +++ b/front_end/panels/timeline/components/IgnoreListSetting.test.ts @@ -78,11 +78,11 @@ describeWithEnvironment('Ignore List Setting', () => { const ignoredRules = getAllRules(component); // There is a default rule `/node_modules/|/bower_components/` - assert.deepStrictEqual(ignoredRules.length, 2); - assert.deepStrictEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/'); - assert.deepStrictEqual(ignoredRules[0].disabled, false); - assert.deepStrictEqual(ignoredRules[1].regex, 'rule 1'); - assert.deepStrictEqual(ignoredRules[1].disabled, false); + assert.deepEqual(ignoredRules.length, 2); + assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/'); + assert.deepEqual(ignoredRules[0].disabled, false); + assert.deepEqual(ignoredRules[1].regex, 'rule 1'); + assert.deepEqual(ignoredRules[1].disabled, false); // Check the remove buttons are rendered assert.isNotNull(component.shadowRoot); @@ -100,11 +100,11 @@ describeWithEnvironment('Ignore List Setting', () => { const ignoredRules = getAllRules(component); // There is a default rule `/node_modules/|/bower_components/` - assert.deepStrictEqual(ignoredRules.length, 2); - assert.deepStrictEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/'); - assert.deepStrictEqual(ignoredRules[0].disabled, false); - assert.deepStrictEqual(ignoredRules[1].regex, 'rule 1'); - assert.deepStrictEqual(ignoredRules[1].disabled, true); + assert.deepEqual(ignoredRules.length, 2); + assert.deepEqual(ignoredRules[0].regex, '/node_modules/|/bower_components/'); + assert.deepEqual(ignoredRules[0].disabled, false); + assert.deepEqual(ignoredRules[1].regex, 'rule 1'); + assert.deepEqual(ignoredRules[1].disabled, true); }); it('Able to toggle the disable status of an ignore listed rules', async () => { diff --git a/front_end/panels/timeline/components/LiveMetricsView.test.ts b/front_end/panels/timeline/components/LiveMetricsView.test.ts index 125083f2e3..e68f51d019 100644 --- a/front_end/panels/timeline/components/LiveMetricsView.test.ts +++ b/front_end/panels/timeline/components/LiveMetricsView.test.ts @@ -249,7 +249,7 @@ describeWithMockConnection('LiveMetricsView', () => { const phases1 = Array.from(interactionsEls[0].querySelectorAll('.phase-table-row:not(.phase-table-header-row)')) .map(el => el.innerText); - assert.deepStrictEqual(phases1, [ + assert.deepEqual(phases1, [ 'Input delay\n100', 'Processing duration\n300', 'Presentation delay\n100', @@ -268,7 +268,7 @@ describeWithMockConnection('LiveMetricsView', () => { const phases2 = Array.from(interactionsEls[1].querySelectorAll('.phase-table-row:not(.phase-table-header-row)')) .map(el => el.innerText); - assert.deepStrictEqual(phases2, [ + assert.deepEqual(phases2, [ 'Input delay\n10', 'Processing duration\n10', 'Presentation delay\n10', diff --git a/front_end/panels/timeline/components/MetricCard.test.ts b/front_end/panels/timeline/components/MetricCard.test.ts index b3fe1076a5..f2d8f4ef3a 100644 --- a/front_end/panels/timeline/components/MetricCard.test.ts +++ b/front_end/panels/timeline/components/MetricCard.test.ts @@ -195,7 +195,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const warnings = getWarnings(view); - assert.deepStrictEqual(warnings, [ + assert.deepEqual(warnings, [ 'LCP warning', ]); }); @@ -235,7 +235,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const phaseTable = getPhaseTable(view); - assert.deepStrictEqual(phaseTable, [ + assert.deepEqual(phaseTable, [ ['TTFB', '500'], ['Phase 1', '0'], ['Phase 2', '124'], @@ -288,7 +288,7 @@ describeWithMockConnection('MetricCard', () => { assert.match(histogramLabels[2], /Poor\s+\(>4.00 s\)/); const histogramPercents = getFieldHistogramPercents(view); - assert.deepStrictEqual(histogramPercents, ['50%', '30%', '20%']); + assert.deepEqual(histogramPercents, ['50%', '30%', '20%']); const fieldValueEl = getFieldMetricValue(view); assert.strictEqual(fieldValueEl!.textContent, '0.20 s'); @@ -310,7 +310,7 @@ describeWithMockConnection('MetricCard', () => { assert.match(histogramLabels[2], /Poor\s+\(>4.00 s\)/); const histogramPercents = getFieldHistogramPercents(view); - assert.deepStrictEqual(histogramPercents, ['-', '-', '-']); + assert.deepEqual(histogramPercents, ['-', '-', '-']); const fieldValueEl = getFieldMetricValue(view); assert.strictEqual(fieldValueEl!.textContent, '-'); @@ -527,7 +527,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const recs = getEnvironmentRecs(view); - assert.deepStrictEqual(recs, [ + assert.deepEqual(recs, [ 'Real users may experience longer page loads due to slower network conditions. Increasing network throttling will simulate slower network conditions.', 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.', 'The LCP element can vary between page loads if content is dynamic.', @@ -547,7 +547,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const recs = getEnvironmentRecs(view); - assert.deepStrictEqual(recs, [ + assert.deepEqual(recs, [ 'Screen size can influence what the LCP element is. Ensure you are testing common viewport sizes.', 'The LCP element can vary between page loads if content is dynamic.', ]); @@ -566,7 +566,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const recs = getEnvironmentRecs(view); - assert.deepStrictEqual(recs, [ + assert.deepEqual(recs, [ 'Screen size can influence what layout shifts happen. Ensure you are testing common viewport sizes.', 'How a user interacts with the page can influence layout shifts. Ensure you are testing common interactions like scrolling the page.', 'Dynamic content can influence what layout shifts happen.', @@ -586,7 +586,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const recs = getEnvironmentRecs(view); - assert.deepStrictEqual(recs, [ + assert.deepEqual(recs, [ 'Real users may experience longer interactions due to slower CPU speeds. Increasing CPU throttling will simulate a slower device.', 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.', ]); @@ -605,7 +605,7 @@ describeWithMockConnection('MetricCard', () => { await coordinator.done(); const recs = getEnvironmentRecs(view); - assert.deepStrictEqual(recs, [ + assert.deepEqual(recs, [ 'How a user interacts with the page influences interaction delays. Ensure you are testing common interactions.', ]); }); diff --git a/front_end/panels/timeline/components/OriginMap.test.ts b/front_end/panels/timeline/components/OriginMap.test.ts index 2a511aa565..b36d6aed44 100644 --- a/front_end/panels/timeline/components/OriginMap.test.ts +++ b/front_end/panels/timeline/components/OriginMap.test.ts @@ -138,7 +138,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const mappings = getOriginMappings(view); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], ]); }); @@ -156,7 +156,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const mappings = getOriginMappings(view); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ [ 'http://localhost:8080', 'https://no-data.com', @@ -178,7 +178,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const mappings = getOriginMappings(view); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://no-data.com', undefined], ]); }); @@ -196,7 +196,7 @@ describeWithMockConnection('OriginMap', () => { { const mappings = getOriginMappings(view); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], ]); } @@ -213,7 +213,7 @@ describeWithMockConnection('OriginMap', () => { { const mappings = getOriginMappings(view); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], ['http://localhost:8081', 'https://example2.com', undefined], ]); @@ -252,7 +252,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const mappings = getOriginMappings(originMap); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], ]); }); @@ -277,7 +277,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const mappings = getOriginMappings(originMap); - assert.deepStrictEqual(mappings, []); + assert.deepEqual(mappings, []); assert.isNull(getDevInput(originMap)); assert.isNull(getProdInput(originMap)); }); @@ -302,7 +302,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const mappings = getOriginMappings(originMap); - assert.deepStrictEqual(mappings, [ + assert.deepEqual(mappings, [ ['http://localhost:8080', 'https://example.com', undefined], ]); }); @@ -323,8 +323,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const errors = getValidationErrors(originMap); - assert.deepStrictEqual( - errors, '"bad-origin" is not a valid origin or URL.\n"jj**Sdafsdf" is not a valid origin or URL.'); + assert.deepEqual(errors, '"bad-origin" is not a valid origin or URL.\n"jj**Sdafsdf" is not a valid origin or URL.'); const confirmButton = getConfirmButton(originMap); assert.isTrue(confirmButton!.shadowRoot?.querySelector('button')!.disabled); @@ -354,7 +353,7 @@ describeWithMockConnection('OriginMap', () => { await coordinator.done(); const errors = getValidationErrors(originMap); - assert.deepStrictEqual(errors, '"http://localhost:8080" is already mapped to a production origin.'); + assert.deepEqual(errors, '"http://localhost:8080" is already mapped to a production origin.'); const confirmButton = getConfirmButton(originMap); assert.isFalse(confirmButton!.shadowRoot?.querySelector('button')!.disabled); diff --git a/front_end/panels/timeline/components/Utils.test.ts b/front_end/panels/timeline/components/Utils.test.ts index 993b1bba13..1f03f7a4e6 100644 --- a/front_end/panels/timeline/components/Utils.test.ts +++ b/front_end/panels/timeline/components/Utils.test.ts @@ -29,39 +29,37 @@ describeWithEnvironment('Utils', () => { it('parse', () => { // en - assert.deepStrictEqual(NumberWithUnit.parse('100[s]()'), {firstPart: '100', unitPart: 's', lastPart: ''}); - assert.deepStrictEqual(NumberWithUnit.parse('100 [s]()'), {firstPart: '100 ', unitPart: 's', lastPart: ''}); + assert.deepEqual(NumberWithUnit.parse('100[s]()'), {firstPart: '100', unitPart: 's', lastPart: ''}); + assert.deepEqual(NumberWithUnit.parse('100 [s]()'), {firstPart: '100 ', unitPart: 's', lastPart: ''}); // Decimal separators - assert.deepStrictEqual( - NumberWithUnit.parse('100.123[ms]()'), {firstPart: '100.123', unitPart: 'ms', lastPart: ''}); - assert.deepStrictEqual(NumberWithUnit.parse('100,2[s]()'), {firstPart: '100,2', unitPart: 's', lastPart: ''}); + assert.deepEqual(NumberWithUnit.parse('100.123[ms]()'), {firstPart: '100.123', unitPart: 'ms', lastPart: ''}); + assert.deepEqual(NumberWithUnit.parse('100,2[s]()'), {firstPart: '100,2', unitPart: 's', lastPart: ''}); // zh - assert.deepStrictEqual(NumberWithUnit.parse('100[毫秒]()'), {firstPart: '100', unitPart: '毫秒', lastPart: ''}); + assert.deepEqual(NumberWithUnit.parse('100[毫秒]()'), {firstPart: '100', unitPart: '毫秒', lastPart: ''}); // zh-Hans-CN-u-nu-hanidec - assert.deepStrictEqual( - NumberWithUnit.parse('一〇〇[毫秒]()'), {firstPart: '一〇〇', unitPart: '毫秒', lastPart: ''}); + assert.deepEqual(NumberWithUnit.parse('一〇〇[毫秒]()'), {firstPart: '一〇〇', unitPart: '毫秒', lastPart: ''}); // ar-SA (RTL language, but the UIString still places the number first in the string) - assert.deepStrictEqual( + assert.deepEqual( NumberWithUnit.parse('١٠٠[ملي ثانية]()'), {firstPart: '١٠٠', unitPart: 'ملي ثانية', lastPart: ''}); // ar - assert.deepStrictEqual( + assert.deepEqual( NumberWithUnit.parse('100[ملي ثانية]()'), {firstPart: '100', unitPart: 'ملي ثانية', lastPart: ''}); // sw (only one that places unit first) - assert.deepStrictEqual(NumberWithUnit.parse('[Sek]()100'), {firstPart: '', unitPart: 'Sek', lastPart: '100'}); - assert.deepStrictEqual(NumberWithUnit.parse('[Sek]() 100'), {firstPart: '', unitPart: 'Sek', lastPart: ' 100'}); + assert.deepEqual(NumberWithUnit.parse('[Sek]()100'), {firstPart: '', unitPart: 'Sek', lastPart: '100'}); + assert.deepEqual(NumberWithUnit.parse('[Sek]() 100'), {firstPart: '', unitPart: 'Sek', lastPart: ' 100'}); // error cases - assert.deepStrictEqual(NumberWithUnit.parse(''), null); - assert.deepStrictEqual(NumberWithUnit.parse('100s'), null); - assert.deepStrictEqual(NumberWithUnit.parse('100[s]('), null); - assert.deepStrictEqual(NumberWithUnit.parse('100[s]'), null); - assert.deepStrictEqual(NumberWithUnit.parse('100[s'), null); - assert.deepStrictEqual(NumberWithUnit.parse('100 s]('), null); + assert.deepEqual(NumberWithUnit.parse(''), null); + assert.deepEqual(NumberWithUnit.parse('100s'), null); + assert.deepEqual(NumberWithUnit.parse('100[s]('), null); + assert.deepEqual(NumberWithUnit.parse('100[s]'), null); + assert.deepEqual(NumberWithUnit.parse('100[s'), null); + assert.deepEqual(NumberWithUnit.parse('100 s]('), null); }); }); diff --git a/front_end/panels/timeline/track_appenders/ThreadAppender.test.ts b/front_end/panels/timeline/track_appenders/ThreadAppender.test.ts index b6b0445f28..2bee0637d1 100644 --- a/front_end/panels/timeline/track_appenders/ThreadAppender.test.ts +++ b/front_end/panels/timeline/track_appenders/ThreadAppender.test.ts @@ -75,7 +75,7 @@ describeWithEnvironment('ThreadAppender', function() { 'Thread', 'Thread', ]; - assert.deepStrictEqual(threadAppenders.map(g => g.appenderName), expectedAppenderNames); + assert.deepEqual(threadAppenders.map(g => g.appenderName), expectedAppenderNames); }); it('renders tracks for threads in correct order', async function() { @@ -87,7 +87,7 @@ describeWithEnvironment('ThreadAppender', function() { it('renders tracks for threads in correct order when a process url is about:blank', async function() { const {flameChartData} = await renderThreadAppendersFromTrace(this, 'about-blank-first.json.gz'); const groupNames = flameChartData.groups.map(g => g.name.replace(/(new-tab-page\/).*/, '$1')); - assert.deepStrictEqual(groupNames.slice(0, 3), [ + assert.deepEqual(groupNames.slice(0, 3), [ 'Frame — chrome-untrusted://new-tab-page/', 'Main — chrome://new-tab-page/', 'Main — about:blank', @@ -109,7 +109,7 @@ describeWithEnvironment('ThreadAppender', function() { Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER, Timeline.TimelineFlameChartDataProvider.EntryType.TRACK_APPENDER, ]; - assert.deepStrictEqual(entryTypeByLevel, execptedLevelTypes); + assert.deepEqual(entryTypeByLevel, execptedLevelTypes); }); it('creates a flamechart groups for track headers and titles', async function() { @@ -122,7 +122,7 @@ describeWithEnvironment('ThreadAppender', function() { 'Thread pool', 'Thread pool worker 1', ]; - assert.deepStrictEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); + assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); }); it('builds flamechart groups for nested tracks correctly', async function() { @@ -153,7 +153,7 @@ describeWithEnvironment('ThreadAppender', function() { 'Thread pool worker 1', 'Thread pool worker 2', ]; - assert.deepStrictEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); + assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); }); it('adds thread IDs onto tracks when the trace is generic', async () => { @@ -184,7 +184,7 @@ describeWithEnvironment('ThreadAppender', function() { 'Thread pool worker 1', 'Thread pool worker 2', ]; - assert.deepStrictEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); + assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); }); it('returns the correct title for a renderer event', async function() { @@ -370,7 +370,7 @@ describeWithEnvironment('ThreadAppender', function() { // This second "worker" is the ThreadPoolServiceThread. TODO: perhaps hide ThreadPoolServiceThread completely? 'Thread pool worker 2', ]; - assert.deepStrictEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); + assert.deepEqual(flameChartData.groups.map(g => g.name), expectedTrackNames); }); describe('ignore listing', () => { diff --git a/front_end/panels/whats_new/ReleaseNoteView.test.ts b/front_end/panels/whats_new/ReleaseNoteView.test.ts index 8d4335885f..2b73ed960b 100644 --- a/front_end/panels/whats_new/ReleaseNoteView.test.ts +++ b/front_end/panels/whats_new/ReleaseNoteView.test.ts @@ -62,10 +62,10 @@ describeWithEnvironment('Release Note View', () => { for (let i = 0; i < 2; ++i) { assert.lengthOf(splitContent[i], 2); - assert.deepStrictEqual(splitContent[i][0].type, 'heading'); - assert.deepStrictEqual(splitContent[i][1].type, 'paragraph'); - assert.deepStrictEqual(splitContent[i][0].raw, content[i * 2]); - assert.deepStrictEqual(splitContent[i][1].raw, content[i * 2 + 1]); + assert.deepEqual(splitContent[i][0].type, 'heading'); + assert.deepEqual(splitContent[i][1].type, 'paragraph'); + assert.deepEqual(splitContent[i][0].raw, content[i * 2]); + assert.deepEqual(splitContent[i][1].raw, content[i * 2 + 1]); } }); @@ -81,10 +81,10 @@ describeWithEnvironment('Release Note View', () => { assert.lengthOf(splitContent, 1); assert.lengthOf(splitContent[0], 4); - assert.deepStrictEqual(splitContent[0][0].raw, h1); - assert.deepStrictEqual(splitContent[0][1].raw, CONTENT1); - assert.deepStrictEqual(splitContent[0][2].raw, h2); - assert.deepStrictEqual(splitContent[0][3].raw, CONTENT2); + assert.deepEqual(splitContent[0][0].raw, h1); + assert.deepEqual(splitContent[0][1].raw, CONTENT1); + assert.deepEqual(splitContent[0][2].raw, h2); + assert.deepEqual(splitContent[0][3].raw, CONTENT2); }); it('splits headerless paragraphs into its own section', async () => { @@ -98,8 +98,8 @@ describeWithEnvironment('Release Note View', () => { assert.lengthOf(splitContent[0], 1); assert.lengthOf(splitContent[1], 1); - assert.deepStrictEqual(splitContent[0][0].raw, CONTENT1); - assert.deepStrictEqual(splitContent[1][0].raw, h1); + assert.deepEqual(splitContent[0][0].raw, CONTENT1); + assert.deepEqual(splitContent[1][0].raw, h1); }); it('renders markdown content', async () => { @@ -136,7 +136,7 @@ describeWithEnvironment('Release Note View', () => { const releaseNotes = WhatsNew.ReleaseNoteText.getReleaseNote(); const descriptions = Array.from(videos).map(n => n.innerText.trim()); const expectedDescriptions = releaseNotes.videoLinks.map(video => video.description); - assert.deepStrictEqual(descriptions, expectedDescriptions); + assert.deepEqual(descriptions, expectedDescriptions); }); it('renders expected thumbnails', async () => { @@ -154,6 +154,6 @@ describeWithEnvironment('Release Note View', () => { ]; const expectedFilepaths = expectedThumbnails.map(src => new URL(src, import.meta.url).toString()); - assert.deepStrictEqual(thumbnailFilepaths, expectedFilepaths); + assert.deepEqual(thumbnailFilepaths, expectedFilepaths); }); }); diff --git a/front_end/ui/components/cards/Card.test.ts b/front_end/ui/components/cards/Card.test.ts index bb42fde6fb..1db39be865 100644 --- a/front_end/ui/components/cards/Card.test.ts +++ b/front_end/ui/components/cards/Card.test.ts @@ -16,7 +16,7 @@ import * as Cards from './cards.js'; function assertCardContent(card: Cards.Card.Card, slotName: string, expectedContent: string[]) { const slot = getElementWithinComponent(card, `slot[name="${slotName}"]`, HTMLSlotElement); const textContents = Array.from(slot.assignedElements()).map(child => child.textContent); - assert.deepStrictEqual(textContents, expectedContent); + assert.deepEqual(textContents, expectedContent); } describe('Card', () => { diff --git a/front_end/ui/components/highlighting/HighlightManager.test.ts b/front_end/ui/components/highlighting/HighlightManager.test.ts index 0301e65540..4376a5b05c 100644 --- a/front_end/ui/components/highlighting/HighlightManager.test.ts +++ b/front_end/ui/components/highlighting/HighlightManager.test.ts @@ -36,15 +36,15 @@ describe('HighlightManager', () => { it('correctly translates ranges', () => { // "text" // ^^ - assert.deepStrictEqual(toText(walk('text').nextRange(2, 2)), 'xt'); + assert.deepEqual(toText(walk('text').nextRange(2, 2)), 'xt'); // "abcdef" // ^ ^ - assert.deepStrictEqual(toText(walk('abc

def

').nextRange(2, 3)), 'cde'); + assert.deepEqual(toText(walk('abc

def

').nextRange(2, 3)), 'cde'); // "abcdefghi" // ^ ^ - assert.deepStrictEqual(toText(walk('abc

def

ghi').nextRange(2, 6)), 'cdefgh'); + assert.deepEqual(toText(walk('abc

def

ghi').nextRange(2, 6)), 'cdefgh'); // "" // ^ @@ -67,9 +67,9 @@ describe('HighlightManager', () => { // "abcdefghi" // ^^^^^^^^^ const walker = walk('abc

def

ghi'); - assert.deepStrictEqual(toText(walker.nextRange(0, 3)), 'abc'); - assert.deepStrictEqual(toText(walker.nextRange(3, 3)), 'def'); - assert.deepStrictEqual(toText(walker.nextRange(6, 3)), 'ghi'); + assert.deepEqual(toText(walker.nextRange(0, 3)), 'abc'); + assert.deepEqual(toText(walker.nextRange(3, 3)), 'def'); + assert.deepEqual(toText(walker.nextRange(6, 3)), 'ghi'); }); it('correctly highlights ranges', () => { @@ -84,6 +84,6 @@ describe('HighlightManager', () => { ]); const highlight = CSS.highlights.get(Highlighting.HighlightManager.HIGHLIGHT_REGISTRY); assert.strictEqual(highlight?.size, 3); - assert.deepStrictEqual(Array.from(highlight!.keys()), ranges); + assert.deepEqual(Array.from(highlight!.keys()), ranges); }); }); diff --git a/front_end/ui/components/markdown_view/MarkdownView.test.ts b/front_end/ui/components/markdown_view/MarkdownView.test.ts index 70f634fbc7..cfd7cce884 100644 --- a/front_end/ui/components/markdown_view/MarkdownView.test.ts +++ b/front_end/ui/components/markdown_view/MarkdownView.test.ts @@ -33,7 +33,7 @@ function renderTemplateResult(templateResult: LitHtml.TemplateResult): HTMLEleme describeWithEnvironment('MarkdownView', () => { describe('tokenizer', () => { it('tokenizers links in single quotes', () => { - assert.deepStrictEqual(Marked.Marked.lexer('\'https://example.com\''), [ + assert.deepEqual(Marked.Marked.lexer('\'https://example.com\''), [ { raw: '\'https://example.com\'', text: '\'https://example.com\'', @@ -93,15 +93,15 @@ describeWithEnvironment('MarkdownView', () => { const code = container.querySelector('code'); assert.exists(code); - assert.deepStrictEqual(code.textContent, 'const foo = 42;'); + assert.deepEqual(code.textContent, 'const foo = 42;'); }); it('renders childless text tokens as-is', () => { const container = renderTemplateResult(renderer.renderToken(getFakeToken({type: 'text', text: 'Simple text token'}))); - assert.deepStrictEqual(container.childTextNodes().length, 1); - assert.deepStrictEqual(container.childTextNodes()[0].textContent, 'Simple text token'); + assert.deepEqual(container.childTextNodes().length, 1); + assert.deepEqual(container.childTextNodes()[0].textContent, 'Simple text token'); }); it('renders nested text tokens correctly', () => { @@ -117,7 +117,7 @@ describeWithEnvironment('MarkdownView', () => { assert.notInclude(container.textContent, 'This text should not be rendered. Only the subtokens!'); assert.include(container.textContent, 'Nested raw text'); assert.exists(container.querySelector('code')); - assert.deepStrictEqual(container.querySelector('code')?.textContent, 'and a nested codespan to boot'); + assert.deepEqual(container.querySelector('code')?.textContent, 'and a nested codespan to boot'); }); it('throws an error for invalid or unsupported token types', () => { @@ -303,7 +303,7 @@ ${paragraphText} const listItems = Array.from(component.shadowRoot.querySelectorAll('li')); assert.strictEqual(listItems.length, 2); - assert.deepStrictEqual(listItems.map(item => item.textContent), listItemTexts); + assert.deepEqual(listItems.map(item => item.textContent), listItemTexts); }); it('renders a codeblock', () => { diff --git a/front_end/ui/legacy/SuggestBox.test.ts b/front_end/ui/legacy/SuggestBox.test.ts index b69b1bda16..b50cee2863 100644 --- a/front_end/ui/legacy/SuggestBox.test.ts +++ b/front_end/ui/legacy/SuggestBox.test.ts @@ -64,7 +64,7 @@ describeWithLocale('SuggestBox', () => { suggestBox.updateSuggestions( anchorBox, [{text: 'First'}, {text: 'Hello'}, {text: 'The best suggestion'}], true, true, 'e'); - assert.deepStrictEqual(delegate.appliedSuggestions, [{suggestion: 'First', isIntermediateSuggestion: true}]); + assert.deepEqual(delegate.appliedSuggestions, [{suggestion: 'First', isIntermediateSuggestion: true}]); }); it('selects no item when "canShowForSingleItem" is false', () => { @@ -72,7 +72,7 @@ describeWithLocale('SuggestBox', () => { anchorBox, [{text: 'First'}, {text: 'Hello', priority: 2}, {text: 'The best suggestion', priority: 5}], false, true, 'e'); - assert.deepStrictEqual(delegate.appliedSuggestions, []); + assert.deepEqual(delegate.appliedSuggestions, []); }); it('selects the highest priority item', () => { @@ -80,7 +80,7 @@ describeWithLocale('SuggestBox', () => { anchorBox, [{text: 'First'}, {text: 'Hello', priority: 2}, {text: 'The best suggestion', priority: 5}], true, true, 'e'); - assert.deepStrictEqual( + assert.deepEqual( delegate.appliedSuggestions, [{suggestion: 'The best suggestion', isIntermediateSuggestion: true}]); }); @@ -95,7 +95,7 @@ describeWithLocale('SuggestBox', () => { suggestBox.keyPressed(createKeyEvent('ArrowDown')); suggestBox.keyPressed(createKeyEvent('ArrowDown')); - assert.deepStrictEqual(delegate.appliedSuggestions, [ + assert.deepEqual(delegate.appliedSuggestions, [ {suggestion: 'The best suggestion', isIntermediateSuggestion: true}, {suggestion: 'Hello', isIntermediateSuggestion: true}, {suggestion: 'First', isIntermediateSuggestion: true}, @@ -111,7 +111,7 @@ describeWithLocale('SuggestBox', () => { true, 'e'); suggestBox.keyPressed(createKeyEvent('Enter')); - assert.deepStrictEqual(delegate.accceptedSuggestions, ['The best suggestion']); + assert.deepEqual(delegate.accceptedSuggestions, ['The best suggestion']); }); it('closes the controller element after accepting a suggestion', () => { diff --git a/front_end/ui/legacy/components/color_picker/Spectrum.test.ts b/front_end/ui/legacy/components/color_picker/Spectrum.test.ts index 35d701494b..d508b712c6 100644 --- a/front_end/ui/legacy/components/color_picker/Spectrum.test.ts +++ b/front_end/ui/legacy/components/color_picker/Spectrum.test.ts @@ -61,6 +61,6 @@ describeWithMockConnection('PaletteGenerator', () => { const palette = await new Promise(r => new ColorPicker.Spectrum.PaletteGenerator(r)); - assert.deepStrictEqual(palette.colors, ['#0f0']); + assert.deepEqual(palette.colors, ['#0f0']); }); }); diff --git a/front_end/ui/legacy/components/inline_editor/ColorMixSwatch.test.ts b/front_end/ui/legacy/components/inline_editor/ColorMixSwatch.test.ts index 529b924c97..1037d5b087 100644 --- a/front_end/ui/legacy/components/inline_editor/ColorMixSwatch.test.ts +++ b/front_end/ui/legacy/components/inline_editor/ColorMixSwatch.test.ts @@ -50,7 +50,7 @@ describeWithLocale('ColorMixSwatch', () => { swatch.setColorMixText('color-mix(in hsl, yellow, yellow)'); assert.lengthOf(cb.getCalls(), 4); - assert.deepStrictEqual(values, [ + assert.deepEqual(values, [ 'color-mix(in srgb, red, red)', 'color-mix(in srgb, blue, red)', 'color-mix(in srgb, blue, purple)', diff --git a/front_end/ui/legacy/components/perf_ui/FilmStripView.test.ts b/front_end/ui/legacy/components/perf_ui/FilmStripView.test.ts index d14976c1e7..9301c34285 100644 --- a/front_end/ui/legacy/components/perf_ui/FilmStripView.test.ts +++ b/front_end/ui/legacy/components/perf_ui/FilmStripView.test.ts @@ -51,7 +51,7 @@ describeWithEnvironment('FilmStripView', function() { // expected text. assert.strictEqual(timeElement.innerText.replace(/\s/, ''), expectedTimeLabelsForFrames[index]); }); - assert.deepStrictEqual(1, 1); + assert.deepEqual(1, 1); filmStrip.detach(); }); diff --git a/front_end/ui/lit-html/static.test.ts b/front_end/ui/lit-html/static.test.ts index 17ca52667e..e24b224b50 100644 --- a/front_end/ui/lit-html/static.test.ts +++ b/front_end/ui/lit-html/static.test.ts @@ -19,45 +19,45 @@ describe('Static', () => { describe('flattenTemplate', () => { it('does not flatten template strings with no statics or values', () => { const content = LitHtml.flattenTemplate`No update needed`; - assert.deepStrictEqual(content.strings, templateArray(['No update needed'])); - assert.deepStrictEqual(content.valueMap, []); + assert.deepEqual(content.strings, templateArray(['No update needed'])); + assert.deepEqual(content.valueMap, []); }); it('does not flatten template strings with just values', () => { const content = LitHtml.flattenTemplate`Just ${1} value`; - assert.deepStrictEqual(content.strings, templateArray(['Just ', ' value'])); - assert.deepStrictEqual(content.valueMap, [true]); + assert.deepEqual(content.strings, templateArray(['Just ', ' value'])); + assert.deepEqual(content.valueMap, [true]); }); it('does flatten template strings with statics', () => { const tag = LitHtml.literal`div`; const content = LitHtml.flattenTemplate`<${tag}>Foo`; - assert.deepStrictEqual(content.strings, templateArray(['
Foo
'])); - assert.deepStrictEqual(content.valueMap, [false, false]); + assert.deepEqual(content.strings, templateArray(['
Foo
'])); + assert.deepEqual(content.valueMap, [false, false]); }); it('does flatten template strings with statics but leaves values alone', () => { const tag = LitHtml.literal`div`; const name = 'Everyone!'; const content = LitHtml.flattenTemplate`<${tag}>Hello, ${name}!`; - assert.deepStrictEqual(content.strings, templateArray(['
Hello, ', '!
'])); - assert.deepStrictEqual(content.valueMap, [false, true, false]); + assert.deepEqual(content.strings, templateArray(['
Hello, ', '!
'])); + assert.deepEqual(content.valueMap, [false, true, false]); }); it('ignores data values', () => { const tag = LitHtml.literal`div`; const name = 'everyone!'; const content = LitHtml.flattenTemplate`<${tag} .data={{x: 1}}>Hello, ${name}!`; - assert.deepStrictEqual(content.strings, templateArray(['
Hello, ', '!
'])); - assert.deepStrictEqual(content.valueMap, [false, true, false]); + assert.deepEqual(content.strings, templateArray(['
Hello, ', '!
'])); + assert.deepEqual(content.valueMap, [false, true, false]); }); it('flattens multiple values', () => { const tag = LitHtml.literal`div`; const message = 'Hello, everyone!'; const content = LitHtml.flattenTemplate`<${tag}>${1}${2}${3}, ${message}! ${'Static value'}!`; - assert.deepStrictEqual(content.strings, templateArray(['
', '', '', ', ', '! ', '!
'])); - assert.deepStrictEqual(content.valueMap, [false, true, true, true, true, true, false]); + assert.deepEqual(content.strings, templateArray(['
', '', '', ', ', '! ', '!
'])); + assert.deepEqual(content.valueMap, [false, true, true, true, true, true, false]); }); }); @@ -134,7 +134,7 @@ describe('Static', () => { const result = LitHtml.i18nTemplate(strings, uiStrings.placeholder, {string: 'STRING', template: html`TEMPLATE`}); const element = LitHtml.render(result, document.createElement('div'), {host: this}); - assert.deepStrictEqual( + assert.deepEqual( (element.parentNode as HTMLDivElement).innerText, 'a message with a STRING and TEMPLATE placeholder'); }); @@ -146,7 +146,7 @@ describe('Static', () => { const result = LitHtml.i18nTemplate(strings, uiStrings.placeholder, {string: 'STRING', template: html`TEMPLATE`}); const element = LitHtml.render(result, document.createElement('div'), {host: this}); - assert.deepStrictEqual( + assert.deepEqual( (element.parentNode as HTMLDivElement).innerText, 'a message with a TEMPLATE and STRING placeholder'); }); }); diff --git a/front_end/ui/visual_logging/DomState.test.ts b/front_end/ui/visual_logging/DomState.test.ts index 96fb972607..89ebb0c31f 100644 --- a/front_end/ui/visual_logging/DomState.test.ts +++ b/front_end/ui/visual_logging/DomState.test.ts @@ -191,25 +191,25 @@ describe('DomState', () => {
`; - assert.deepStrictEqual( + assert.deepEqual( VisualLogging.DomState.visibleOverlap(el('1'), new DOMRect(0, 0, 200, 200)), new DOMRect(50, 0, 100, 100)); - assert.deepStrictEqual( + assert.deepEqual( VisualLogging.DomState.visibleOverlap(el('2'), new DOMRect(0, 0, 200, 200)), new DOMRect(0, 50, 100, 100)); - assert.deepStrictEqual( + assert.deepEqual( VisualLogging.DomState.visibleOverlap(el('1'), new DOMRect(0, 0, 100, 100)), new DOMRect(50, 0, 50, 100)); - assert.deepStrictEqual( + assert.deepEqual( VisualLogging.DomState.visibleOverlap(el('2'), new DOMRect(0, 0, 100, 100)), new DOMRect(0, 50, 100, 50)); assert.isNull(VisualLogging.DomState.visibleOverlap(el('1'), new DOMRect(0, 0, 50, 50))); assert.isNull(VisualLogging.DomState.visibleOverlap(el('2'), new DOMRect(0, 0, 50, 50))); assert.isNull(VisualLogging.DomState.visibleOverlap(el('1'), new DOMRect(0, 0, 50, 100))); - assert.deepStrictEqual( + assert.deepEqual( VisualLogging.DomState.visibleOverlap(el('2'), new DOMRect(0, 0, 50, 100)), new DOMRect(0, 50, 50, 50)); assert.isNull(VisualLogging.DomState.visibleOverlap(el('1'), new DOMRect(25, 25, 25, 50))); - assert.deepStrictEqual( + assert.deepEqual( VisualLogging.DomState.visibleOverlap(el('2'), new DOMRect(25, 25, 25, 50)), new DOMRect(25, 50, 25, 25)); assert.isNull(VisualLogging.DomState.visibleOverlap(el('1'), new DOMRect(25, 25, 30, 30))); diff --git a/front_end/ui/visual_logging/LoggingDriver.test.ts b/front_end/ui/visual_logging/LoggingDriver.test.ts index 60990b5919..00af3109e2 100644 --- a/front_end/ui/visual_logging/LoggingDriver.test.ts +++ b/front_end/ui/visual_logging/LoggingDriver.test.ts @@ -353,8 +353,7 @@ describe('LoggingDriver', () => { await expectCalled(throttle).then(([logging]) => logging()); assert.isTrue(recordClick.calledOnce); - assert.deepStrictEqual( - recordClick.firstCall.firstArg, {veid: getVeId(select.selectedOptions[0]), doubleClick: false}); + assert.deepEqual(recordClick.firstCall.firstArg, {veid: getVeId(select.selectedOptions[0]), doubleClick: false}); }); it('logs keydown', async () => { @@ -631,7 +630,7 @@ describe('LoggingDriver', () => { element.dispatchEvent(new MouseEvent('mouseover')); await expectCalled(throttle).then(([work]) => work()); assert.isTrue(recordHover.called); - assert.deepStrictEqual(recordHover.firstCall.firstArg, {veid: getVeId(element)}); + assert.deepEqual(recordHover.firstCall.firstArg, {veid: getVeId(element)}); }); it('logs drag', async () => { @@ -740,7 +739,7 @@ describe('LoggingDriver', () => { logging(); await expectCalled(recordResize); assert.isTrue(recordResize.calledOnce); - assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 0, height: 0}); + assert.deepEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 0, height: 0}); recordResize.resetHistory(); @@ -750,7 +749,7 @@ describe('LoggingDriver', () => { await expectCall(recordResize); assert.isTrue(recordResize.calledOnce); - assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 300, height: 300}); + assert.deepEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 300, height: 300}); }); it('throttles resize per element', async () => { @@ -803,7 +802,7 @@ describe('LoggingDriver', () => { await work(); await expectCalled(recordResize); assert.isTrue(recordResize.calledOnce); - assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 400, height: 300}); + assert.deepEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 400, height: 300}); }); it('does not log resize intial impressions due to visibility change', async () => { @@ -887,7 +886,7 @@ describe('LoggingDriver', () => { await logging(); assert.isTrue(recordResize.calledOnce); - assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 0, height: 0}); + assert.deepEqual(recordResize.firstCall.firstArg, {veid: getVeId(element), width: 0, height: 0}); }); it('logs click, then resize, then impressions', async () => { diff --git a/front_end/ui/visual_logging/LoggingEvents.test.ts b/front_end/ui/visual_logging/LoggingEvents.test.ts index bb97479a7c..add06f3ef9 100644 --- a/front_end/ui/visual_logging/LoggingEvents.test.ts +++ b/front_end/ui/visual_logging/LoggingEvents.test.ts @@ -57,7 +57,7 @@ describe('LoggingEvents', () => { const event = new MouseEvent('click', {button: 0, sourceCapabilities: new InputDeviceCapabilities()}); VisualLogging.LoggingEvents.logClick(throttler)(element, event); await assertThrottled(recordClick); - assert.deepStrictEqual(recordClick.firstCall.firstArg, {veid, mouseButton: 0, doubleClick: false}); + assert.deepEqual(recordClick.firstCall.firstArg, {veid, mouseButton: 0, doubleClick: false}); }); it('does not set mouse button for synthetic clicks', async () => { @@ -68,7 +68,7 @@ describe('LoggingEvents', () => { const event = new MouseEvent('click', {button: 0}); VisualLogging.LoggingEvents.logClick(throttler)(element, event); await assertThrottled(recordClick); - assert.deepStrictEqual(recordClick.firstCall.firstArg, {veid, doubleClick: false}); + assert.deepEqual(recordClick.firstCall.firstArg, {veid, doubleClick: false}); }); it('calls UI binding to log a double click', async () => { @@ -79,7 +79,7 @@ describe('LoggingEvents', () => { const event = new MouseEvent('dblclick', {button: 1}); VisualLogging.LoggingEvents.logClick(throttler)(element, event, {doubleClick: true}); await assertThrottled(recordClick); - assert.deepStrictEqual(recordClick.firstCall.firstArg, {veid, doubleClick: true}); + assert.deepEqual(recordClick.firstCall.firstArg, {veid, doubleClick: true}); }); it('calls UI binding to log a change', async () => { @@ -89,7 +89,7 @@ describe('LoggingEvents', () => { ); await VisualLogging.LoggingEvents.logChange(element); assert.isTrue(recordChange.calledOnce); - assert.deepStrictEqual(recordChange.firstCall.firstArg, {veid}); + assert.deepEqual(recordChange.firstCall.firstArg, {veid}); }); it('calls UI binding to log a change of specific type', async () => { @@ -100,7 +100,7 @@ describe('LoggingEvents', () => { VisualLogging.LoggingState.getLoggingState(element)!.pendingChangeContext = 'instertText'; await VisualLogging.LoggingEvents.logChange(element); assert.isTrue(recordChange.calledOnce); - assert.deepStrictEqual(recordChange.firstCall.firstArg, {veid, context: 296063892}); + assert.deepEqual(recordChange.firstCall.firstArg, {veid, context: 296063892}); }); it('calls UI binding to log a keydown with any code', async () => { @@ -111,7 +111,7 @@ describe('LoggingEvents', () => { const event = new KeyboardEvent('keydown'); void VisualLogging.LoggingEvents.logKeyDown(throttler)(element, event); await assertThrottled(recordKeyDown); - assert.deepStrictEqual(recordKeyDown.firstCall.firstArg, {veid}); + assert.deepEqual(recordKeyDown.firstCall.firstArg, {veid}); }); it('calls UI binding to log a keydown with a matching code', async () => { @@ -123,7 +123,7 @@ describe('LoggingEvents', () => { VisualLogging.LoggingState.getLoggingState(element)!.config.track = {keydown: 'Enter|Escape'}; void VisualLogging.LoggingEvents.logKeyDown(throttler)(element, event); await assertThrottled(recordKeyDown); - assert.deepStrictEqual(recordKeyDown.firstCall.firstArg, {veid, context: 513111094}); + assert.deepEqual(recordKeyDown.firstCall.firstArg, {veid, context: 513111094}); }); it('calls UI binding to log a keydown with a matching key', async () => { @@ -135,7 +135,7 @@ describe('LoggingEvents', () => { VisualLogging.LoggingState.getLoggingState(element)!.config.track = {keydown: '>'}; void VisualLogging.LoggingEvents.logKeyDown(throttler)(element, event); await assertThrottled(recordKeyDown); - assert.deepStrictEqual(recordKeyDown.firstCall.firstArg, {veid: getVeId(element), context: -1098575095}); + assert.deepEqual(recordKeyDown.firstCall.firstArg, {veid: getVeId(element), context: -1098575095}); }); it('calls UI binding to log a keydown with an provided context', async () => { @@ -146,7 +146,7 @@ describe('LoggingEvents', () => { const event = new KeyboardEvent('keydown', {code: 'Enter'}); void VisualLogging.LoggingEvents.logKeyDown(throttler)(element, event, '21'); await assertThrottled(recordKeyDown); - assert.deepStrictEqual(recordKeyDown.firstCall.firstArg, {veid, context: 21}); + assert.deepEqual(recordKeyDown.firstCall.firstArg, {veid, context: 21}); }); it('throttles subsequent keydowns', async () => { @@ -173,8 +173,8 @@ describe('LoggingEvents', () => { assert.isTrue(recordKeyDown.calledOnce); await throttler.process?.(); assert.isTrue(recordKeyDown.calledTwice); - assert.deepStrictEqual(recordKeyDown.firstCall.firstArg, {veid, context: 1}); - assert.deepStrictEqual(recordKeyDown.secondCall.firstArg, {veid, context: 2}); + assert.deepEqual(recordKeyDown.firstCall.firstArg, {veid, context: 1}); + assert.deepEqual(recordKeyDown.secondCall.firstArg, {veid, context: 2}); }); it('throttles subsequent keydowns with the same context', async () => { @@ -187,7 +187,7 @@ describe('LoggingEvents', () => { void VisualLogging.LoggingEvents.logKeyDown(throttler)(element, event, '1'); void VisualLogging.LoggingEvents.logKeyDown(throttler)(element, event, '1'); await assertThrottled(recordKeyDown); - assert.deepStrictEqual(recordKeyDown.firstCall.firstArg, {veid, context: 1}); + assert.deepEqual(recordKeyDown.firstCall.firstArg, {veid, context: 1}); }); it('does not call UI binding to log a keydown with a non-matching code', async () => { @@ -210,7 +210,7 @@ describe('LoggingEvents', () => { sinon.stub(event, 'currentTarget').value(element); void VisualLogging.LoggingEvents.logHover(new Common.Throttler.Throttler(0))(event); await expectCalled(recordHover); - assert.deepStrictEqual(recordHover.firstCall.firstArg, {veid}); + assert.deepEqual(recordHover.firstCall.firstArg, {veid}); }); it('calls UI binding to log a drag event', async () => { @@ -222,7 +222,7 @@ describe('LoggingEvents', () => { sinon.stub(event, 'currentTarget').value(element); void VisualLogging.LoggingEvents.logDrag(throttler)(event); await assertThrottled(recordDrag); - assert.deepStrictEqual(recordDrag.firstCall.firstArg, {veid}); + assert.deepEqual(recordDrag.firstCall.firstArg, {veid}); }); it('calls UI binding to log a resize event', async () => { @@ -231,7 +231,7 @@ describe('LoggingEvents', () => { 'recordResize', ); VisualLogging.LoggingEvents.logResize(element, new DOMRect(0, 0, 100, 50)); - assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid, width: 100, height: 50}); + assert.deepEqual(recordResize.firstCall.firstArg, {veid, width: 100, height: 50}); }); it('throttles calls UI binding to log a resize event', async () => { @@ -240,6 +240,6 @@ describe('LoggingEvents', () => { 'recordResize', ); VisualLogging.LoggingEvents.logResize(element, new DOMRect(0, 0, 100, 50)); - assert.deepStrictEqual(recordResize.firstCall.firstArg, {veid, width: 100, height: 50}); + assert.deepEqual(recordResize.firstCall.firstArg, {veid, width: 100, height: 50}); }); }); diff --git a/inspector_overlay/css_grid_label_helpers.test.ts b/inspector_overlay/css_grid_label_helpers.test.ts index 36b3df26cb..ea718ab9dc 100644 --- a/inspector_overlay/css_grid_label_helpers.test.ts +++ b/inspector_overlay/css_grid_label_helpers.test.ts @@ -537,7 +537,7 @@ describe('normalizePositionData', () => { allPoints: [{x: 0, y: 0}, {x: 100, y: 0}, {x: 100, y: 100}, {x: 0, y: 100}], }); - assert.deepStrictEqual(data, { + assert.deepEqual(data, { bounds: { minX: 0, maxX: 100, @@ -590,10 +590,10 @@ describe('normalizePositionData', () => { allPoints: [{x: 0, y: 0}, {x: 100, y: 0}, {x: 100, y: 100}, {x: 0, y: 100}], }); - assert.deepStrictEqual(data.rows.positive.positions.map(p => p.y), [2, 6, 10, 124]); - assert.deepStrictEqual(data.rows.negative.positions.map(p => p.y), [3, 6, 28, 50]); - assert.deepStrictEqual(data.columns.positive.positions.map(p => p.x), [1, 1, 2]); - assert.deepStrictEqual(data.columns.negative.positions.map(p => p.x), [2, 6, 11]); + assert.deepEqual(data.rows.positive.positions.map(p => p.y), [2, 6, 10, 124]); + assert.deepEqual(data.rows.negative.positions.map(p => p.y), [3, 6, 28, 50]); + assert.deepEqual(data.columns.positive.positions.map(p => p.x), [1, 1, 2]); + assert.deepEqual(data.columns.negative.positions.map(p => p.x), [2, 6, 11]); }); it('detects first and last positions', () => { @@ -670,10 +670,10 @@ describe('normalizePositionData', () => { allPoints: [{x: 0, y: 0}, {x: 30, y: 0}, {x: 30, y: 30}, {x: 0, y: 30}], }); - assert.deepStrictEqual(data.rows.positive.positions, [{x: 0, y: 5}, {x: 0, y: 20}]); - assert.deepStrictEqual(data.rows.positive.names, [['foo', 'bar', 'baz'], ['test']]); - assert.deepStrictEqual(data.columns.positive.positions, [{x: 15, y: 0}, {x: 17, y: 0}]); - assert.deepStrictEqual(data.columns.positive.names, [['edge-start'], ['edge-end']]); + assert.deepEqual(data.rows.positive.positions, [{x: 0, y: 5}, {x: 0, y: 20}]); + assert.deepEqual(data.rows.positive.names, [['foo', 'bar', 'baz'], ['test']]); + assert.deepEqual(data.columns.positive.positions, [{x: 15, y: 0}, {x: 17, y: 0}]); + assert.deepEqual(data.columns.positive.names, [['edge-start'], ['edge-end']]); }); }); diff --git a/inspector_overlay/highlight_common.test.ts b/inspector_overlay/highlight_common.test.ts index aa7a889316..afe4ab501a 100644 --- a/inspector_overlay/highlight_common.test.ts +++ b/inspector_overlay/highlight_common.test.ts @@ -14,17 +14,17 @@ describe('highlight common helper', () => { assert.strictEqual(bounds.minY, 60); assert.strictEqual(bounds.maxX, 420); assert.strictEqual(bounds.maxY, 204); - assert.deepStrictEqual(bounds.leftmostXForY, {[60]: 100, [204]: 100}); - assert.deepStrictEqual(bounds.bottommostYForX, {[100]: 204, [420]: 204}); - assert.deepStrictEqual(bounds.rightmostXForY, {[60]: 420, [204]: 420}); - assert.deepStrictEqual(bounds.topmostYForX, {[100]: 60, [420]: 60}); + assert.deepEqual(bounds.leftmostXForY, {[60]: 100, [204]: 100}); + assert.deepEqual(bounds.bottommostYForX, {[100]: 204, [420]: 204}); + assert.deepEqual(bounds.rightmostXForY, {[60]: 420, [204]: 420}); + assert.deepEqual(bounds.topmostYForX, {[100]: 60, [420]: 60}); }); it('can map points using writing-mode matrices', () => { const point = {x: 0, y: 0}; const matrix = new DOMMatrix(); - assert.deepStrictEqual( + assert.deepEqual( applyMatrixToPoint(point, matrix), {x: 0, y: 0}, 'The identity matrix does not move the point', @@ -33,7 +33,7 @@ describe('highlight common helper', () => { point.x = 10; point.y = 10; matrix.translateSelf(10, 10, 0); - assert.deepStrictEqual( + assert.deepEqual( applyMatrixToPoint(point, matrix), {x: 20, y: 20}, 'A simple translation matrix does transform a point', diff --git a/inspector_overlay/highlight_flex_common.test.ts b/inspector_overlay/highlight_flex_common.test.ts index 58773a1dc4..09a97b831c 100644 --- a/inspector_overlay/highlight_flex_common.test.ts +++ b/inspector_overlay/highlight_flex_common.test.ts @@ -82,10 +82,10 @@ describe('getLinesAndItemsQuads', () => { const lineQuads = getLinesAndItemsQuads( createPathCommands(0, 0, 10, 0, 10, 10, 0, 10), [[createItem(2, 2, 8, 2, 8, 8, 2, 8)]], true, false); - assert.deepStrictEqual(lineQuads[0].quad.p1, {x: 0, y: 0}); - assert.deepStrictEqual(lineQuads[0].quad.p2, {x: 10, y: 0}); - assert.deepStrictEqual(lineQuads[0].quad.p3, {x: 10, y: 10}); - assert.deepStrictEqual(lineQuads[0].quad.p4, {x: 0, y: 10}); + assert.deepEqual(lineQuads[0].quad.p1, {x: 0, y: 0}); + assert.deepEqual(lineQuads[0].quad.p2, {x: 10, y: 0}); + assert.deepEqual(lineQuads[0].quad.p3, {x: 10, y: 10}); + assert.deepEqual(lineQuads[0].quad.p4, {x: 0, y: 10}); }); it('creates quads for flex lines that extend to the edges of the container in the main direction', () => { @@ -104,9 +104,9 @@ describe('getLinesAndItemsQuads', () => { ], true, false); - assert.deepStrictEqual(lineQuadsRowDirection[0].quad, createQuad(0, 10, 100, 10, 100, 30, 0, 30)); + assert.deepEqual(lineQuadsRowDirection[0].quad, createQuad(0, 10, 100, 10, 100, 30, 0, 30)); - assert.deepStrictEqual(lineQuadsRowDirection[1].quad, createQuad(0, 40, 100, 40, 100, 70, 0, 70)); + assert.deepEqual(lineQuadsRowDirection[1].quad, createQuad(0, 40, 100, 40, 100, 70, 0, 70)); const lineQuadsColumnDirection = getLinesAndItemsQuads( createPathCommands(0, 0, 50, 0, 50, 70, 0, 70), @@ -122,9 +122,9 @@ describe('getLinesAndItemsQuads', () => { ], false, false); - assert.deepStrictEqual(lineQuadsColumnDirection[0].quad, createQuad(10, 0, 20, 0, 20, 70, 10, 70)); + assert.deepEqual(lineQuadsColumnDirection[0].quad, createQuad(10, 0, 20, 0, 20, 70, 10, 70)); - assert.deepStrictEqual(lineQuadsColumnDirection[1].quad, createQuad(30, 0, 40, 0, 40, 70, 30, 70)); + assert.deepEqual(lineQuadsColumnDirection[1].quad, createQuad(30, 0, 40, 0, 40, 70, 30, 70)); }); it('creates normal and extended quads for items', () => { @@ -138,18 +138,18 @@ describe('getLinesAndItemsQuads', () => { ], true, false); - assert.deepStrictEqual( + assert.deepEqual( lineQuads[0].items[0], createQuad(10, 10, 30, 10, 30, 30, 10, 30), 'The first flex item quad matches the item'); - assert.deepStrictEqual( + assert.deepEqual( lineQuads[0].items[1], createQuad(40, 10, 60, 10, 60, 30, 40, 30), 'The second flex item quad matches the item'); - assert.deepStrictEqual( + assert.deepEqual( lineQuads[0].extendedItems[0], createQuad(10, 0, 30, 0, 30, 40, 10, 40), 'The first flex item extended quad extends to the cross edge of the flex line'); - assert.deepStrictEqual( + assert.deepEqual( lineQuads[0].extendedItems[1], createQuad(40, 0, 60, 0, 60, 40, 40, 40), 'The second flex item extended quad extends to the cross edge of the flex line'); }); @@ -169,13 +169,13 @@ describe('getLinesAndItemsQuads', () => { ], true, false); - assert.deepStrictEqual(lineQuads[0].quad, createQuad(20, 80, 80, 20, 90, 30, 30, 90)); - assert.deepStrictEqual(lineQuads[0].extendedItems[0], createQuad(30, 70, 50, 50, 60, 60, 40, 80)); - assert.deepStrictEqual(lineQuads[0].extendedItems[1], createQuad(60, 40, 70, 30, 80, 40, 70, 50)); + assert.deepEqual(lineQuads[0].quad, createQuad(20, 80, 80, 20, 90, 30, 30, 90)); + assert.deepEqual(lineQuads[0].extendedItems[0], createQuad(30, 70, 50, 50, 60, 60, 40, 80)); + assert.deepEqual(lineQuads[0].extendedItems[1], createQuad(60, 40, 70, 30, 80, 40, 70, 50)); - assert.deepStrictEqual(lineQuads[1].quad, createQuad(30, 90, 90, 30, 100, 40, 40, 100)); - assert.deepStrictEqual(lineQuads[1].extendedItems[0], createQuad(40, 80, 50, 70, 60, 80, 50, 90)); - assert.deepStrictEqual(lineQuads[1].extendedItems[1], createQuad(50, 70, 80, 40, 90, 50, 60, 80)); + assert.deepEqual(lineQuads[1].quad, createQuad(30, 90, 90, 30, 100, 40, 40, 100)); + assert.deepEqual(lineQuads[1].extendedItems[0], createQuad(40, 80, 50, 70, 60, 80, 50, 90)); + assert.deepEqual(lineQuads[1].extendedItems[1], createQuad(50, 70, 80, 40, 90, 50, 60, 80)); }); }); @@ -299,7 +299,7 @@ describe('getGapQuadBetweenQuads', () => { true, false, ); - assert.deepStrictEqual(quadV, createQuad(0, 10, 60, 10, 60, 20, 0, 20)); + assert.deepEqual(quadV, createQuad(0, 10, 60, 10, 60, 20, 0, 20)); const quadVReversed = getGapQuadBetweenQuads( createQuad(0, 20, 60, 20, 60, 30, 0, 30), @@ -308,7 +308,7 @@ describe('getGapQuadBetweenQuads', () => { true, true, ); - assert.deepStrictEqual(quadVReversed, quadV); + assert.deepEqual(quadVReversed, quadV); const quadH = getGapQuadBetweenQuads( createQuad(0, 0, 10, 0, 10, 50, 50, 0), @@ -317,7 +317,7 @@ describe('getGapQuadBetweenQuads', () => { false, false, ); - assert.deepStrictEqual(quadH, createQuad(10, 0, 20, 0, 20, 50, 10, 50)); + assert.deepEqual(quadH, createQuad(10, 0, 20, 0, 20, 50, 10, 50)); const quadHReversed = getGapQuadBetweenQuads( createQuad(20, 0, 30, 0, 30, 50, 50, 20), @@ -326,7 +326,7 @@ describe('getGapQuadBetweenQuads', () => { false, true, ); - assert.deepStrictEqual(quadHReversed, quadH); + assert.deepEqual(quadHReversed, quadH); }); it('works when the gap is smaller than the distance between the quads', () => { @@ -337,7 +337,7 @@ describe('getGapQuadBetweenQuads', () => { true, false, ); - assert.deepStrictEqual(quad, createQuad(0, 30, 30, 30, 30, 40, 0, 40)); + assert.deepEqual(quad, createQuad(0, 30, 30, 30, 30, 40, 0, 40)); }); it('works when the quads are transformed', () => { @@ -350,7 +350,7 @@ describe('getGapQuadBetweenQuads', () => { ); // The rounding of coordinates ends up 1px off, but this won't really matter visually, so the test just accounts for // it here. - assert.deepStrictEqual(quad, createQuad(31, 51, 51, 31, 59, 39, 39, 59)); + assert.deepEqual(quad, createQuad(31, 51, 51, 31, 59, 39, 39, 59)); }); }); @@ -362,7 +362,7 @@ describe('uniteQuads', () => { true, false, ); - assert.deepStrictEqual(quad, createQuad(0, 10, 40, 10, 40, 40, 0, 40)); + assert.deepEqual(quad, createQuad(0, 10, 40, 10, 40, 40, 0, 40)); }); it('can be called multiple times with the previously united quad to construct a flex line out of flex items', () => { @@ -384,7 +384,7 @@ describe('uniteQuads', () => { true, false, ); - assert.deepStrictEqual(quad, createQuad(0, 0, 180, 0, 180, 50, 0, 50)); + assert.deepEqual(quad, createQuad(0, 0, 180, 0, 180, 50, 0, 50)); }); it('also works when the quads are transformed', () => { @@ -394,7 +394,7 @@ describe('uniteQuads', () => { false, false, ); - assert.deepStrictEqual(quad, createQuad(0, 20, 20, 0, 80, 60, 60, 80)); + assert.deepEqual(quad, createQuad(0, 20, 20, 0, 80, 60, 60, 80)); }); }); @@ -405,7 +405,7 @@ describe('growQuadToEdgesOf', () => { createQuad(0, 0, 60, 0, 60, 30, 0, 30), true, ); - assert.deepStrictEqual(quad, createQuad(0, 10, 60, 10, 60, 20, 0, 20)); + assert.deepEqual(quad, createQuad(0, 10, 60, 10, 60, 20, 0, 20)); }); it('works vertically', () => { @@ -414,7 +414,7 @@ describe('growQuadToEdgesOf', () => { createQuad(0, 0, 60, 0, 60, 30, 0, 30), false, ); - assert.deepStrictEqual(quad, createQuad(10, 0, 20, 0, 20, 30, 10, 30)); + assert.deepEqual(quad, createQuad(10, 0, 20, 0, 20, 30, 10, 30)); }); it('works with transformed quads', () => { @@ -423,14 +423,14 @@ describe('growQuadToEdgesOf', () => { createQuad(10, 60, 60, 10, 100, 50, 50, 100), true, ); - assert.deepStrictEqual(quad, createQuad(20, 70, 70, 20, 90, 40, 40, 90)); + assert.deepEqual(quad, createQuad(20, 70, 70, 20, 90, 40, 40, 90)); }); }); describe('getColinearPointAtDistance', () => { function assertPoint(p1: Position, p2: Position, distance: number, expected: Position): void { const point = getColinearPointAtDistance(p1, p2, distance); - assert.deepStrictEqual({x: Math.round(point.x), y: Math.round(point.y)}, expected); + assert.deepEqual({x: Math.round(point.x), y: Math.round(point.y)}, expected); } it('returns the right coordinates when the line is horizontal', () => { @@ -453,7 +453,7 @@ describe('getColinearPointAtDistance', () => { describe('distance', () => { function assertDistance(p1: Position, p2: Position, expected: number): void { const d = distance(p1, p2); - assert.deepStrictEqual(Math.round(d), expected); + assert.deepEqual(Math.round(d), expected); } it('works', () => { @@ -491,7 +491,7 @@ describe('segmentContains', () => { describe('intersectSegments', () => { function assertIntersection(s1: Position[], s2: Position[], expected: Position): void { const point = intersectSegments(s1, s2); - assert.deepStrictEqual({x: Math.round(point.x), y: Math.round(point.y)}, expected); + assert.deepEqual({x: Math.round(point.x), y: Math.round(point.y)}, expected); } it('works when x or y is 0', () => { diff --git a/scripts/eslint_rules/lib/no-assert-deep-strict-equal.js b/scripts/eslint_rules/lib/no-assert-deep-strict-equal.js new file mode 100644 index 0000000000..77b9c9dd45 --- /dev/null +++ b/scripts/eslint_rules/lib/no-assert-deep-strict-equal.js @@ -0,0 +1,61 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +'use strict'; + +/** + * @fileoverview Disallow usage of `assert.deepStrictEqual`. + * + * In chai, `deepStrictEqual` is an alias for `deepEqual`, and we want to + * consistently use the latter to not leave developers wondering what's + * the difference between these two. Also the `strict` part in the name might + * lead to the wrong conclusion that this is about strict equality. + */ + +// ------------------------------------------------------------------------------ +// Rule Definition +// ------------------------------------------------------------------------------ + +/** @type {import('eslint').Rule.RuleModule} */ +module.exports = { + meta: { + type: 'suggestion', + + docs: { + description: 'Disallow usage of `assert.deepStrictEqual` in favor of `assert.deepEqual`.', + category: 'Best Practices', + }, + messages: { + unexpectedAssertDeepStrictEqual: 'Unexpected assert.deepStrictEqual. Use assert.deepEqual instead.', + }, + fixable: 'code', + schema: [], // no options + }, + create: function (context) { + function isAssertDeepStrictEqual(calleeNode) { + return calleeNode.type === 'MemberExpression' && + calleeNode.object.type === 'Identifier' && + calleeNode.object.name === 'assert' && + calleeNode.property.type === 'Identifier' && + calleeNode.property.name === 'deepStrictEqual'; + } + + function reportError(node) { + context.report({ + node, + messageId: 'unexpectedAssertDeepStrictEqual', + fix(fixer) { + return fixer.replaceText(node.callee.property, 'deepEqual'); + } + }); + } + + return { + CallExpression(node) { + if (isAssertDeepStrictEqual(node.callee)) { + reportError(node); + } + } + }; + }, +}; diff --git a/scripts/eslint_rules/tests/no-assert-deep-strict-equal.test.js b/scripts/eslint_rules/tests/no-assert-deep-strict-equal.test.js new file mode 100644 index 0000000000..e5ddc6a4ea --- /dev/null +++ b/scripts/eslint_rules/tests/no-assert-deep-strict-equal.test.js @@ -0,0 +1,53 @@ +// Copyright 2024 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +'use strict'; + +const rule = require('../lib/no-assert-deep-strict-equal.js'); +const ruleTester = new (require('eslint').RuleTester)({ + parserOptions: {ecmaVersion: 9, sourceType: 'module'}, +}); + +ruleTester.run('no-assert-deep-strict-equal', rule, { + valid: [ + { + code: 'assert.deepEqual(array, [1, 2]);', + filename: 'foo.ts', + }, + { + code: 'bar.deepStrictEqual(array, [1, 2]);', + filename: 'foo.ts', + }, + { + code: 'foo.assert.deepStrictEqual(array, [1, 2]);', + filename: 'foo.ts', + }, + { + code: 'const fn = assert.deepStrictEqual;', + filename: 'foo.ts', + }, + ], + + invalid: [ + { + code: 'assert.deepStrictEqual(array, [1, 2]);', + output: 'assert.deepEqual(array, [1, 2]);', + filename: 'foo.ts', + errors: [ + { + messageId: 'unexpectedAssertDeepStrictEqual', + }, + ], + }, + { + code: 'assert.deepStrictEqual(array, [1, 2], "Some message");', + output: 'assert.deepEqual(array, [1, 2], "Some message");', + filename: 'foo.ts', + errors: [ + { + messageId: 'unexpectedAssertDeepStrictEqual', + }, + ], + }, + ], +}); diff --git a/test/e2e/ai_assistance/ai_assistance_test.ts b/test/e2e/ai_assistance/ai_assistance_test.ts index b706730f46..9194ff6159 100644 --- a/test/e2e/ai_assistance/ai_assistance_test.ts +++ b/test/e2e/ai_assistance/ai_assistance_test.ts @@ -201,7 +201,7 @@ STOP`, 'ANSWER: changed styles', ], }); - assert.deepStrictEqual( + assert.deepEqual( result.at(-1)!.request.current_message, {role: 1, parts: [{text: 'OBSERVATION: {"color":"rgb(0, 0, 0)"}'}]}); }); @@ -228,7 +228,7 @@ STOP`, ], }, ); - assert.deepStrictEqual( + assert.deepEqual( result.at(-1)!.request.current_message, {role: 1, parts: [{text: 'OBSERVATION: {"aspectRatio":"auto"}'}]}); }); @@ -253,7 +253,7 @@ STOP`, 'ANSWER: changed styles', ], }); - assert.deepStrictEqual( + assert.deepEqual( result.at(-1)!.request.current_message, {role: 1, parts: [{text: 'OBSERVATION: {"aspectRatio":"auto"}'}]}); }); @@ -305,7 +305,7 @@ STOP`, iframeId: 'iframe', }); - assert.deepStrictEqual(result.at(-1)!.request.current_message.parts[0], { + assert.deepEqual(result.at(-1)!.request.current_message.parts[0], { text: 'OBSERVATION: {"title":"I have a title"}', }); }); diff --git a/test/e2e/application/window-controls_test.ts b/test/e2e/application/window-controls_test.ts index fd32ebbf3c..7362bd2ab6 100644 --- a/test/e2e/application/window-controls_test.ts +++ b/test/e2e/application/window-controls_test.ts @@ -26,7 +26,7 @@ describe('The Window Controls Overlay', () => { // Verify dropdown options const options = await controlsDropDown.$$('option'); const values = await Promise.all(options.map(option => option.evaluate(el => el.value))); - assert.deepStrictEqual(values, ['Windows', 'Mac', 'Linux']); + assert.deepEqual(values, ['Windows', 'Mac', 'Linux']); // Verify selecting an option void selectOption(await controlsDropDown.toElement('select'), 'Linux'); diff --git a/test/e2e/console/console-clear_test.ts b/test/e2e/console/console-clear_test.ts index 8bb9aa0bf8..b30b913787 100644 --- a/test/e2e/console/console-clear_test.ts +++ b/test/e2e/console/console-clear_test.ts @@ -62,7 +62,7 @@ describe('The Console Tab', function() { const sideBar = await waitFor('div[slot="sidebar"]'); const entries = await $$('li', sideBar); const entriesText = await Promise.all(entries.map(e => e.evaluate(e => e.textContent))); - assert.deepStrictEqual(entriesText, [ + assert.deepEqual(entriesText, [ '1 message', '1', '1 user message', diff --git a/test/e2e/console/console-fetch-logging_test.ts b/test/e2e/console/console-fetch-logging_test.ts index 7c64f5f3d7..a13d9baace 100644 --- a/test/e2e/console/console-fetch-logging_test.ts +++ b/test/e2e/console/console-fetch-logging_test.ts @@ -36,7 +36,7 @@ describe('The Console Tab', () => { await typeIntoConsoleAndWaitForResult(getBrowserAndPages().frontend, 'await makeRequests();', 4, Level.Info); const result = await getCurrentConsoleMessages(false, Level.Info); - assert.deepStrictEqual(result.slice(0, -1), expectedResults, 'Fetching was not logged correctly'); + assert.deepEqual(result.slice(0, -1), expectedResults, 'Fetching was not logged correctly'); }); it('does not log fetching when XMLHttpRequest Logging is disabled', async () => { diff --git a/test/e2e/console/console-insight_test.ts b/test/e2e/console/console-insight_test.ts index 35bdf648c6..7e8232744f 100644 --- a/test/e2e/console/console-insight_test.ts +++ b/test/e2e/console/console-insight_test.ts @@ -226,7 +226,7 @@ describe('ConsoleInsight', function() { for (let testIdx = 0; testIdx < messages.length; testIdx++) { const messageWithStacktrace = await frontend.evaluate(messageGetter, consoleModule, messages[testIdx], true); - assert.deepStrictEqual(messageWithStacktrace, tests[testIdx].expectedWithStackTrace); + assert.deepEqual(messageWithStacktrace, tests[testIdx].expectedWithStackTrace); } }); }); diff --git a/test/e2e/elements/at-property-sections_test.ts b/test/e2e/elements/at-property-sections_test.ts index e3ac096662..4b64bc744c 100644 --- a/test/e2e/elements/at-property-sections_test.ts +++ b/test/e2e/elements/at-property-sections_test.ts @@ -58,15 +58,15 @@ describe('The styles pane', () => { it('shows registered properties', async () => { await goToResourceAndWaitForStyleSection('elements/at-property.html'); - assert.deepStrictEqual(await getStyleRuleProperties('--my-color', 3), { + assert.deepEqual(await getStyleRuleProperties('--my-color', 3), { properties: [' inherits: false;', ' initial-value: red;', ' syntax: "";'], subtitle: '