Skip to content

Commit

Permalink
expect a specific error
Browse files Browse the repository at this point in the history
  • Loading branch information
eps1lon committed Jul 13, 2021
1 parent 2c9bc48 commit 43699a6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/react-dom/src/__tests__/ReactTestUtilsAct-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ function runActTests(label, render, unmount, rerender) {
let setValue = null;
function App({defaultValue}) {
if (defaultValue === undefined) {
throw new Error();
throw new Error('some error');
}
const [value, _setValue] = React.useState(defaultValue);
setValue = _setValue;
Expand All @@ -262,7 +262,7 @@ function runActTests(label, render, unmount, rerender) {
act(() => {
render(<App defaultValue={undefined} />, container);
});
}).toThrow();
}).toThrow('some error');

act(() => {
rerender(<App defaultValue={0} />, container);
Expand Down

0 comments on commit 43699a6

Please sign in to comment.