mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
chore: bump @testing-library/react
12.1.5
-> 16.0.0
(#8322)
This commit is contained in:
parent
3cf14c73a3
commit
f19ce30dfe
52 changed files with 1035 additions and 978 deletions
|
@ -97,3 +97,19 @@ vi.mock("nanoid", () => {
|
|||
const element = document.createElement("div");
|
||||
element.id = "root";
|
||||
document.body.appendChild(element);
|
||||
|
||||
const logger = console.error.bind(console);
|
||||
console.error = (...args) => {
|
||||
// the react's act() warning usually doesn't contain any useful stack trace
|
||||
// so we're catching the log and re-logging the message with the test name,
|
||||
// also stripping the actual component stack trace as it's not useful
|
||||
if (args[0]?.includes("act(")) {
|
||||
logger(
|
||||
`<<< WARNING: test "${
|
||||
expect.getState().currentTestName
|
||||
}" does not wrap some state update in act() >>>`,
|
||||
);
|
||||
} else {
|
||||
logger(...args);
|
||||
}
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue