From fa8489d2c295ed4571020227602d3d07c74ca66c Mon Sep 17 00:00:00 2001 From: Adam Raine <6752989+adamraine@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:50:04 -0700 Subject: [PATCH] tests(treemap): ignore cookie deprecation error (#16141) --- treemap/test/treemap-test-pptr.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/treemap/test/treemap-test-pptr.js b/treemap/test/treemap-test-pptr.js index e4e66718a3b8..3c5fd63d370a 100644 --- a/treemap/test/treemap-test-pptr.js +++ b/treemap/test/treemap-test-pptr.js @@ -31,7 +31,7 @@ describe('Lighthouse Treemap', () => { let browser; /** @type {import('puppeteer').Page} */ let page; - /** @type {Error[]} */ + /** @type {Array>} */ let pageErrors = []; let server; @@ -80,7 +80,13 @@ describe('Lighthouse Treemap', () => { async function ensureNoErrors() { await page.bringToFront(); await page.evaluate(() => new Promise(window.requestAnimationFrame)); - const errors = await claimErrors(); + const errors = (await claimErrors()).filter(error => { + // Filters out a cookie deprecation error that only occurs on ToT + // This error comes from gtag.js + // https://support.google.com/tagmanager/thread/288419928/error-failed-to-execute-getvalue-on-cookiedeprecationlabel?hl=en + return !error.match( + /Failed to execute 'getValue' on 'CookieDeprecationLabel': Illegal invocation/); + }); expect(errors).toHaveLength(0); }