Skip to content

Commit

Permalink
Update tests with new error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
davidblurton committed Jan 28, 2017
1 parent 6aeca26 commit 916a82f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/renderers/dom/fiber/__tests__/ReactDOMFiber-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1127,9 +1127,9 @@ describe('disableNewFiberFeatures', () => {
return props.children;
}

expect(() => ReactDOM.render(<Render>Hi</Render>, container)).toThrow(/You may have returned undefined/);
expect(() => ReactDOM.render(<Render>{999}</Render>, container)).toThrow(/You may have returned undefined/);
expect(() => ReactDOM.render(<Render>[<div />]</Render>, container)).toThrow(/You may have returned undefined/);
expect(() => ReactDOM.render(<Render>Hi</Render>, container)).toThrow(/You returned string/);
expect(() => ReactDOM.render(<Render>{999}</Render>, container)).toThrow(/You returned number/);
expect(() => ReactDOM.render(<Render>[<div />]</Render>, container)).toThrow(/You returned an array/);
});

it('treats mocked render functions as if they return null', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ describe('ReactStatelessComponent', () => {
expect(function() {
ReactTestUtils.renderIntoDocument(<div><NotAComponent /></div>);
}).toThrowError(
'NotAComponent(...): A valid React element (or null) must be returned. ' +
'You may have returned undefined, an array or some other invalid object.'
'NotAComponent(...) must return a valid React element (or null). ' +
'You returned an array.'
);
});
}
Expand All @@ -152,8 +152,8 @@ describe('ReactStatelessComponent', () => {
expect(function() {
ReactTestUtils.renderIntoDocument(<div><NotAComponent /></div>);
}).toThrowError(
'NotAComponent(...): A valid React element (or null) must be returned. ' +
'You may have returned undefined, an array or some other invalid object.'
'NotAComponent(...) must return a valid React element (or null). ' +
'You returned undefined.'
);
});

Expand Down

0 comments on commit 916a82f

Please sign in to comment.