import { isImage } from '../is-image'; describe('isImage 函数', () => { it('isImage returns true for image file', () => { const filepath = 'https://xxxx/path/to/image.jpg'; const result = isImage(filepath); expect(result).toBe(true); }); it('isImage returns false for non-image file', () => { const filepath = 'https://xxxx/path/to/document.pdf'; const result = isImage(filepath); expect(result).toBe(false); }); });