Files
photon-tbw/tests/lemmy.test.ts
T
2023-07-08 15:10:59 -07:00

13 lines
556 B
TypeScript

import { isImage } from '../src/lib/ui/image.js'
import { describe, expect, it } from 'vitest'
describe('lemmy utilities', () => {
it('checks image URLs correctly', () => {
expect(isImage(`https://example.com/img.jpg?thumb=28`)).toBeTruthy()
expect(isImage(`https://test.dev/file/img.webp?great`)).toBeTruthy()
expect(isImage(`https://test.dev/file/img.jpeg?test=false`)).toBeTruthy()
expect(isImage(`https://test.dev/file/img.bmp#awesome`)).toBeTruthy()
expect(isImage(`https://test.dev/file/img.png#awesome`)).toBeTruthy()
})
})