From 32ac56055efebff1a2b030cf80d0f68c07ef2c69 Mon Sep 17 00:00:00 2001 From: Adam Raine Date: Fri, 2 Aug 2024 11:55:16 -0700 Subject: [PATCH] tests(treemap): ignore cookie deprecation error --- 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); }