We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5b1f2dd commit b7e38bfCopy full SHA for b7e38bf
test-setup.js
@@ -7,9 +7,14 @@ import '@testing-library/jest-dom/jest-globals';
7
8
// Make the CI fail if console.error in tests
9
let error = console.error;
10
-console.error = message => {
11
- error.apply(message); // keep default behaviour
12
- throw message;
+console.error = (...args) => {
+ error.call(console, args);
+ throw new Error(
13
+ JSON.stringify({
14
+ message: 'The tests failed due to `console.error` calls',
15
+ error: args,
16
+ })
17
+ );
18
};
19
20
// Ignore warnings about act()
0 commit comments