Closed
Description
react-testing-library
version: 1.9.3node
version: 9.2.1
What you did:
Created fresh project from CRA + typescript scripts and then wrote a simple test
test('renders App without crashing', () => {
const { queryByTestId } = render(<App/>);
expect(queryByTestId('app-hoc')).toBeInTheDOM();
});
What happened:
The test is passing but the project does not build. Throwing this error:
Property 'toBeInTheDOM' does not exist on type 'Matchers'.
Problem description:
Typescript won't allow building project when we are using property which does not exist on some particular type (Matchers in this case)
Suggested solution:
Extend jest expect typings with a new types definition for methods from extend-expect.js
Metadata
Metadata
Assignees
Labels
No labels