# 自动化测试策略

质量保障的关键环节。

## 测试金字塔

```
       /▋▋▋▋▋/
      / ▋▋▋▋ /
     /  ▋▋▋   /
    /   ▋▋    /
   /____▋____/
Unit Integration E2E
```

## 单元测试

```javascript
describe('calculateTotal', () => {
  test('should sum items correctly', () => {
    expect(calculateTotal([1, 2, 3])).toBe(6);
  });
});
```

## E2E 测试

使用 Cypress 或 Playwright。

测试覆盖率多少？有没有 CI/CD 集成？