Hi,
I wanted to use jest-fail-on-console as a silencer for the error logs that come from the third-party libraries but still allow errors and warnings to appear in logs and not break tests.
I tried this setup:
failOnConsole({
shouldFailOnError: false,
shouldFailOnWarn: false,
silenceMessage: (errorMessage) => {
if (
/Warning: The current testing environment is not configured to support act/.test(
errorMessage
) ||
/Support for defaultProps will be removed from function components in a future major release/.test(
errorMessage
)
) {
return true;
}
return false;
}
});
However, the selected messages were not silenced unless I set shouldFailOnError to true but then other tests started failing on other console.errors.
Is this expected behavior?
Hi,
I wanted to use jest-fail-on-console as a silencer for the error logs that come from the third-party libraries but still allow errors and warnings to appear in logs and not break tests.
I tried this setup:
However, the selected messages were not silenced unless I set
shouldFailOnErrortotruebut then other tests started failing on other console.errors.Is this expected behavior?