Im relatively new to JS, and can't figure out what is going on in line 2 of the following template jest test in the latest create-react-app:
test('renders learn react link', () => {
const { getByText } = render(<App />);
const linkElement = getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
});
Does render always return a function called getByText? Is this destructuring? Why is it used as a method on the third line?