diff --git a/site/jest.setup.ts b/site/jest.setup.ts index 97332346b7d2c..1bbce8a5e4a6c 100644 --- a/site/jest.setup.ts +++ b/site/jest.setup.ts @@ -38,16 +38,12 @@ afterAll(() => server.close()) // For now, I limited this to just 'error' - but failing on warnings // would be a nice next step! We may need to filter out some noise // from material-ui though. -const CONSOLE_FAIL_TYPES = ["error" /* 'warn' */] +const CONSOLE_FAIL_TYPES = ["error" /* 'warn' */] as const // Throw errors when a `console.error` or `console.warn` happens // by overriding the functions -CONSOLE_FAIL_TYPES.forEach((logType: string) => { - // Suppressing the no-explicit-any to override certain console functions for testing - // eslint-disable-next-line @typescript-eslint/no-explicit-any - const consoleAsAny = global.console as any - // eslint-disable-next-line @typescript-eslint/no-explicit-any - consoleAsAny[logType] = (format: string, ...args: any[]): void => { +CONSOLE_FAIL_TYPES.forEach((logType: typeof CONSOLE_FAIL_TYPES[number]) => { + global.console[logType] = (format: string, ...args: Type[]): void => { throw new Error( `Failing due to console.${logType} while running test!\n\n${util.format(format, ...args)}`, ) pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy