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

Function failTestOnConsoleWarn

scripts/setupTests.js:62–77  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62function failTestOnConsoleWarn() {
63 const warn = console.warn;
64
65 console.warn = function (message) {
66 const allowedPattern =
67 typeof message === 'string' &&
68 WARNING_PATTERNS_WE_SHOULD_FIX_BUT_ALLOW.find(pattern => message.indexOf(pattern) > -1);
69
70 if (allowedPattern) {
71 return;
72 }
73
74 warn.apply(console, arguments);
75 throw message instanceof Error ? message : new Error(message);
76 };
77}
78
79expect.extend({
80 toContainObject(received, argument) {

Callers 1

setupTests.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected