cos-mcp
Version:
基于MCP协议的腾讯云COS MCP Server,无需编码即可让大模型快速接入腾讯云存储(COS)和数据万象(CI)能力
23 lines • 946 B
JavaScript
import { generateOutPutFileId, generateCode } from '../services/utils.js';
describe('utils.ts functions', () => {
describe('generateOutPutFileId function', () => {
it('should generate a valid output file ID', () => {
const objectKey = 'example.txt';
const result = generateOutPutFileId(objectKey);
expect(result).toContain('example');
expect(result).toMatch(/\d{8}_example/); // 日期格式验证
});
});
describe('generateCode function', () => {
it('should generate a code of specified length', () => {
const length = 8;
const code = generateCode(length);
expect(code).toHaveLength(length);
});
it('should generate a secure random code', () => {
const code = generateCode(6, true);
expect(code).toMatch(/^[A-Za-z0-9]+$/);
});
});
});
//# sourceMappingURL=utils.test.js.map