Skip to content

Commit 55a0f87

Browse files
committed
warn -> error for Test Renderer deprecation
We use `console.error` for deprecations. `console.warn` is for less critical issues, like performance anti-patterns.
1 parent b039be6 commit 55a0f87

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

packages/internal-test-utils/shouldIgnoreConsoleError.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ module.exports = function shouldIgnoreConsoleError(format, args) {
2323
) !== -1 ||
2424
format.indexOf(
2525
'ReactDOM.hydrate has not been supported since React 18',
26-
) !== -1
26+
) !== -1 ||
27+
format.indexOf('react-test-renderer is deprecated.') !== -1
2728
) {
2829
// We haven't finished migrating our tests to use createRoot.
2930
return true;
Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
'use strict';
22

33
module.exports = function shouldIgnoreConsoleWarn(format) {
4-
if (typeof format === 'string') {
5-
if (format.indexOf('Warning: react-test-renderer is deprecated.') === 0) {
6-
return true;
7-
}
8-
}
9-
104
return false;
115
};

packages/react-test-renderer/src/ReactTestRenderer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ function create(
475475
enableReactTestRendererWarning === true &&
476476
global.IS_REACT_NATIVE_TEST_ENVIRONMENT !== true
477477
) {
478-
console.warn(
478+
console.error(
479479
'react-test-renderer is deprecated. See https://react.dev/warnings/react-test-renderer',
480480
);
481481
}

0 commit comments

Comments
 (0)