Skip to content

Commit

Permalink
Make the CI fail on console.error in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
erwanMarmelab committed Jan 28, 2025
1 parent 107db17 commit 5b1f2dd
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
import '@testing-library/jest-dom';
import '@testing-library/jest-dom/jest-globals';

// Make the CI fail if console.error in tests
let error = console.error;
console.error = message => {
error.apply(message); // keep default behaviour
throw message;
};

// Ignore warnings about act()
// See https://github.com/testing-library/react-testing-library/issues/281,
// https://github.com/facebook/react/issues/14769
Expand Down

0 comments on commit 5b1f2dd

Please sign in to comment.