MCPcopy Create free account
hub / github.com/adobe/react-spectrum / failTestOnConsoleError

Function failTestOnConsoleError

scripts/setupTests.js:54–68  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52}
53
54function failTestOnConsoleError() {
55 const error = console.error;
56
57 console.error = function (message) {
58 const allowedPattern =
59 typeof message === 'string' &&
60 ERROR_PATTERNS_WE_SHOULD_FIX_BUT_ALLOW.find(pattern => matchesPattern(message, pattern));
61 if (allowedPattern) {
62 return;
63 }
64
65 error.apply(console, arguments);
66 throw message instanceof Error ? message : new Error(message);
67 };
68}
69
70function failTestOnConsoleWarn() {
71 const warn = console.warn;

Callers 1

setupTests.jsFile · 0.85

Calls 1

matchesPatternFunction · 0.85

Tested by

no test coverage detected