Middle+
Do you have experience writing tests? What kind of tests have you written and in what volume?
sobes.tech AI
Answer from AI
Yes, I have experience writing tests. Mainly, I have written:
- Unit tests using Jest and React Testing Library to test individual components and functions.
- Integration tests that check the interaction of multiple components or modules together.
- E2E tests with Cypress to verify user scenarios in the browser.
The scope of testing depends on the project, but usually, unit test coverage is about 70-80%, with integration and E2E tests covering key business processes. This approach helps quickly identify errors and maintain code quality during frontend development.
Here's an example of a simple unit test in React:
import { render, screen } from '@testing-library/react';
import Button from './Button';
test('button displays with correct text', () => {
render(<Button>Click me</Button>);
expect(screen.getByText('Click me')).toBeInTheDocument();
});