Middle
Have you written tests? Which ones specifically?
sobes.tech AI
Answer from AI
Yes, I have written tests for frontend applications. Mainly used:
- Unit tests with Jest to test individual functions and components.
- Integration tests with React Testing Library to test component interactions.
Example of a simple unit test with Jest:
import { sum } from './utils';
test('adds 1 + 2 to equal 3', () => {
expect(sum(1, 2)).toBe(3);
});
Tests help maintain code quality and quickly identify errors when making changes.