diff --git a/__checks__/no-console-errors.spec.ts b/__checks__/no-console-errors.spec.ts index 4e71a9f5..ce69157d 100644 --- a/__checks__/no-console-errors.spec.ts +++ b/__checks__/no-console-errors.spec.ts @@ -22,7 +22,8 @@ for (const path of paths) { const errors: string[] = [] page.on('pageerror', (error) => errors.push(`pageerror: ${error.message}`)) page.on('console', (message) => { - if (message.type() === 'error' && !isIgnored(message.location().url)) { + // A blocked script logs on the page's URL and names the script only in the text. + if (message.type() === 'error' && !isIgnored(message.location().url) && !isIgnored(message.text())) { errors.push(`console.error: ${message.text()} @ ${message.location().url}`) } })