The following package.json files need dependencies updated:
And the template code should be changed to use screen:
import React from 'react';
- import { render } from '@testing-library/react';
+ import { render, screen } from '@testing-library/react';
import App from './App';
test('renders learn react link', () => {
- const { getByText } = render(<App />);
- const linkElement = getByText(/learn react/i);
+ render(<App />);
+ const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
And the same treatment for this one:
I think the rest of the template is irrelevant.
In order to update the dependencies, the templates needs Node 10+.
Right now they're supporting Node 8 (cra-template) & Node 8.10 (cra-template-typescript).
Ah yeah, it would be great if we drop node 8 so we can upgrade jest as well :)
Jest upgrade is happening in #8362
@ianschmitz Not all of this is done, so this one should be re-opened I think 馃檪
We won't drop Node 8 until v4, and will review/update all packages at that time.
Sounds reasonable 馃憤
Most helpful comment
We won't drop Node 8 until v4, and will review/update all packages at that time.