Skip to content

Commit

Permalink
Fix unit tests for React 15.3.1 change
Browse files Browse the repository at this point in the history
React changed the `React.Children.only()` error message:
facebook/react#7514

This updates the unit tests to not rely on testing for the exact
message.
  • Loading branch information
ericf committed Aug 19, 2016
1 parent 2caad99 commit fb992e8
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/unit/components/provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,7 @@ describe('<IntlProvider>', () => {
});

it('throws when no `children`', () => {
expect(() => renderer.render(<IntlProvider />)).toThrow(
'onlyChild must be passed a children with exactly one child.'
);
expect(() => renderer.render(<IntlProvider />)).toThrow();
});

it('throws when more than one `children`', () => {
Expand All @@ -98,9 +96,7 @@ describe('<IntlProvider>', () => {
</IntlProvider>
);

expect(() => renderer.render(el)).toThrow(
'onlyChild must be passed a children with exactly one child.'
);
expect(() => renderer.render(el)).toThrow();
});

it('warns when no `locale` prop is provided', () => {
Expand Down

0 comments on commit fb992e8

Please sign in to comment.