Skip to content

Commit

Permalink
Use toHaveWarnedWith
Browse files Browse the repository at this point in the history
  • Loading branch information
Mamaduka committed Dec 22, 2023
1 parent f093652 commit 0939b95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions packages/compose/src/higher-order/pure/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ describe( 'pure', () => {

// Updating with same props doesn't rerender.
rerender( <MyComp /> );
expect( console ).toHaveWarned();
expect( console ).toHaveWarnedWith(
'wp.compose.pure is deprecated since version 6.5. Please use Use `memo` or `PureComponent` instead instead.'
);
expect( screen.getByTestId( 'counter' ) ).toHaveTextContent( '1' );

// New prop should trigger a rerender.
Expand Down Expand Up @@ -82,7 +84,9 @@ describe( 'pure', () => {
);

const { rerender } = render( <MyComp /> );
expect( console ).toHaveWarned();
expect( console ).toHaveWarnedWith(
'wp.compose.pure is deprecated since version 6.5. Please use Use `memo` or `PureComponent` instead instead.'
);

// Updating with same props doesn't rerender.
rerender( <MyComp /> );
Expand Down

0 comments on commit 0939b95

Please sign in to comment.