Our tests are written with "given-when-then" methodology
it(' should render component', async () => {
// given a render component
render(<App/>)
// should show its content
expect(screen.getByRole('heading').toBeInDocument();
});
Descriptions should follow:
describe('name of regarded test group', () => {})
it('what should happen when tests pass')
Run tests:
yarn test
For NextJs, which uses React, we make usage of jest and react-testing-library