Sobes.tech
Middle

Have you written tests? What experience do you have with testing?

sobes.tech AI

Answer from AI

Yes, I have written tests for frontend applications, mainly using Jest and React Testing Library. My experience includes writing unit tests for components and functions, as well as integration tests to verify interactions between components and APIs. For example, I tested rendering correctness, event handling, and asynchronous requests.

Here's a simple React test example with Jest:

import { render, screen, fireEvent } from '@testing-library/react';
import Button from './Button';

test('button calls handler on click', () => {
  const handleClick = jest.fn();
  render(<Button onClick={handleClick}>Click me</Button>);
  fireEvent.click(screen.getByText('Click me'));
  expect(handleClick).toHaveBeenCalledTimes(1);
});
Have you written tests? What experience do you have… - sobes.tech