Skip to content

No extend-expect type definitions #40

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mbaranovski opened this issue Apr 3, 2018 · 2 comments
Closed

No extend-expect type definitions #40

mbaranovski opened this issue Apr 3, 2018 · 2 comments

Comments

@mbaranovski
Copy link
Contributor

mbaranovski commented Apr 3, 2018

  • react-testing-library version: 1.9.3
  • node 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

@antsmartian
Copy link
Collaborator

@mbaranovski
Copy link
Contributor Author

Hi, I've just noticed that in the README file...
It works thanks. I'll close the issue.

julienw pushed a commit to julienw/react-testing-library that referenced this issue Dec 20, 2018
julienw pushed a commit to julienw/react-testing-library that referenced this issue Dec 20, 2018
There was an issue with a patch release, so this manual-releases.md
change is to release a new patch version.

Reference: testing-library#40
lucbpz pushed a commit to lucbpz/react-testing-library that referenced this issue Jul 26, 2020
…g-library-3.11.3

Update dom-testing-library to the latest version 🚀
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants