gongxiangp2/lib/__tests__/s3-config.test.ts
chenpei 4e89b57798 feat(upload): optimize upload UI and performance
- Expand batch upload list area and optimize preview image layout
- Improve upload speed tracking and display (server-side & client-side)
- Reduce network detection log noise
- Optimize Docker build process (caching, env validation)
- Add shadow environment deployment support
2026-01-28 15:07:50 +08:00

54 lines
1.5 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* R6 测试:S3 连接配置优化
*
* 验证:
* 1. maxAttempts 降低到合理值(5次)
* 2. 保留 adaptive 重试模式
* 3. 有超时配置
*/
describe('R6: S3 连接配置优化', () => {
it('maxAttempts 应该是 5(不是 10)', () => {
const fs = require('fs')
const path = require('path')
const s3Path = path.join(__dirname, '..', 's3.ts')
const content = fs.readFileSync(s3Path, 'utf-8')
// 验证 maxAttempts 配置
expect(content).toContain('maxAttempts: 5')
// 确保不是旧的 10 次配置
expect(content).not.toMatch(/maxAttempts:\s*10\s*[,}]/)
})
it('应该使用 adaptive 重试模式', () => {
const fs = require('fs')
const path = require('path')
const s3Path = path.join(__dirname, '..', 's3.ts')
const content = fs.readFileSync(s3Path, 'utf-8')
// 验证重试模式
expect(content).toContain("retryMode: 'adaptive'")
})
it('应该有请求超时配置', () => {
const fs = require('fs')
const path = require('path')
const s3Path = path.join(__dirname, '..', 's3.ts')
const content = fs.readFileSync(s3Path, 'utf-8')
// 验证超时配置
expect(content).toContain('requestTimeout')
expect(content).toContain('connectionTimeout')
})
it('应该有 R6 修复说明', () => {
const fs = require('fs')
const path = require('path')
const s3Path = path.join(__dirname, '..', 's3.ts')
const content = fs.readFileSync(s3Path, 'utf-8')
// 验证有修复说明
expect(content).toContain('R6修复')
})
})