Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
runtime test cannot be compiled because we now have types guarding in…
Browse files Browse the repository at this point in the history
…put.
  • Loading branch information
rosskevin committed Dec 27, 2017
1 parent f90525d commit 8c3f8e6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions test/client/ApolloProvider.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,18 @@ describe('<ApolloProvider /> Component', () => {
expect(wrapper.contains(<div className="unique" />)).toBeTruthy();
});

it('should throw if rendered without a child component', () => {
const originalConsoleError = console.error;
console.error = () => {
/* noop */
};
expect(() => {
shallow(<ApolloProvider client={client} />);
}).toThrowError(Error);
console.error = originalConsoleError;
});
// NOTE: now that we added types, this fails directly on type checking - we have no way to runtime check
// something that cannot even be compiled.
// it('should throw if rendered without a child component', () => {
// const originalConsoleError = console.error;
// console.error = () => {
// /* noop */
// };
// expect(() => {
// shallow(<ApolloProvider client={client} />);
// }).toThrowError(Error);
// console.error = originalConsoleError;
// });

it('should add the client to the child context', () => {
const tree = TestUtils.renderIntoDocument(
Expand Down

0 comments on commit 8c3f8e6

Please sign in to comment.