Closed
Description
react-testing-library
version: 6.1.1react
version: 16.8.6node
version: 11.10.1yarn
version: 1.13.0jest-dom
version: 3.1.3
What you did:
Just run yarn create react-app from-scratch --typescript
Add the react-testing-library
and jest-dom
to the package.json, update the App.test.tsx
with:
import React from 'react';
import {render, waitForElement } from 'react-testing-library'
import 'jest-dom/extend-expect'
test('tests', async () => {
const { getByTestId } = render(
<div data-testid='error'>something</div>
);
const something = await waitForElement(() => getByTestId('error'))
expect(something).toHaveTextContent('something')
})
What happened:
Reproduction:
Problem description:
The tests pass if I downgrade to:
"react": "16.8.1",
"react-dom": "16.8.1",,
"react-testing-library": "5.5.3",
"jest-dom": "3.0.0"
Suggested solution:
I'm starting the bisect from the versions to see what might be changed.
Activity
kentcdodds commentedon Apr 5, 2019
Yup, this should be fixed in a few minutes :)
fix(act): ensure that the result is returned from our wrapper (#346)
aledustet commentedon Apr 5, 2019
wow @kentcdodds 34 seconds 🔥 🙇
kentcdodds commentedon Apr 5, 2019
@allcontributors[bot], please add @aledustet for bug
allcontributors commentedon Apr 5, 2019
@kentcdodds
I've put up a pull request to add @aledustet! 🎉
kentcdodds commentedon Apr 5, 2019
No problem! Thanks for taking the time to report the issue!
kentcdodds commentedon Apr 5, 2019
🎉 This issue has been resolved in version 6.1.2 🎉
The release is available on:
npm package (@latest dist-tag)
Your semantic-release bot 📦🚀
docs: add ben-dyer as a contributor (testing-library#347)