Skip to content

Commit

Permalink
Silence warning in devtools tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Pope committed Feb 22, 2024
1 parent 063c042 commit 8d6dc31
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
4 changes: 3 additions & 1 deletion packages/react-devtools-shared/src/__tests__/setupTests.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ beforeEach(() => {
jest.useFakeTimers();

// Use utils.js#withErrorsOrWarningsIgnored instead of directly mutating this array.
global._ignoredErrorOrWarningMessages = [];
global._ignoredErrorOrWarningMessages = [
'react-test-renderer is deprecated.',
];
function shouldIgnoreConsoleErrorOrWarn(args) {
let firstArg = args[0];
if (
Expand Down
12 changes: 6 additions & 6 deletions packages/react-devtools-shared/src/__tests__/treeContext-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2586,14 +2586,14 @@ describe('TreeListContext', () => {
utils.act(() => TestRenderer.create(<Contexts />));

expect(store).toMatchInlineSnapshot(`
✕ 1, ⚠ 0
✕ 1, ⚠ 1
[root]
<ErrorBoundary> ✕
`);

selectNextErrorOrWarning();
expect(state).toMatchInlineSnapshot(`
✕ 1, ⚠ 0
✕ 1, ⚠ 1
[root]
→ <ErrorBoundary> ✕
`);
Expand Down Expand Up @@ -2648,14 +2648,14 @@ describe('TreeListContext', () => {
utils.act(() => TestRenderer.create(<Contexts />));

expect(store).toMatchInlineSnapshot(`
✕ 1, ⚠ 0
✕ 1, ⚠ 1
[root]
<ErrorBoundary> ✕
`);

selectNextErrorOrWarning();
expect(state).toMatchInlineSnapshot(`
✕ 1, ⚠ 0
✕ 1, ⚠ 1
[root]
→ <ErrorBoundary> ✕
`);
Expand Down Expand Up @@ -2705,15 +2705,15 @@ describe('TreeListContext', () => {
utils.act(() => TestRenderer.create(<Contexts />));

expect(store).toMatchInlineSnapshot(`
✕ 2, ⚠ 0
✕ 2, ⚠ 1
[root]
▾ <ErrorBoundary> ✕
<Child> ✕
`);

selectNextErrorOrWarning();
expect(state).toMatchInlineSnapshot(`
✕ 2, ⚠ 0
✕ 2, ⚠ 1
[root]
→ ▾ <ErrorBoundary> ✕
<Child> ✕
Expand Down

0 comments on commit 8d6dc31

Please sign in to comment.