Skip to content

Commit

Permalink
Update snapshot tests
Browse files Browse the repository at this point in the history
The warning now is counted on the Child instead of the parent.
However, this won't be released in 19.0 so I only test this in whatever
the next version is.
  • Loading branch information
sebmarkbage committed Jun 6, 2024
1 parent 8eec615 commit 8b54f40
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions packages/react-devtools-shared/src/__tests__/store-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1916,11 +1916,9 @@ describe('Store', () => {
});

// In React 19, JSX warnings were moved into the renderer - https://github.com/facebook/react/pull/29088
// When the error is emitted, the source fiber of this error is not yet mounted
// So DevTools can't connect the error and the fiber
// TODO(hoxyq): update RDT to keep track of such fibers
// @reactVersion >= 19.0
it('from react get counted [React >= 19]', () => {
// The warning is moved to the Child instead of the Parent.
// @reactVersion >= 19.0.1
it('from react get counted [React >= 19.0.1]', () => {
function Example() {
return [<Child />];
}
Expand All @@ -1936,9 +1934,10 @@ describe('Store', () => {
);

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

Expand Down

0 comments on commit 8b54f40

Please sign in to comment.