Tenho um componente em react com varias funções e quero testar apenas uma, só que não consigo puxar essa função no jast e React Testing Library.
Eu tentei fazer dessa forma mas não deu certo, ele retorna erro.
App.js
function somar(x, y) {
return x + y
}
App.test.js
import { render, screen } from '@testing-library/react';
import App from './App';
test('somar', () => {
render(<App />);
const funcaoSoma = somar(10, 10);
expect(funcaoSoma).toEqual(20);
});