feat: Add some more tests

This commit is contained in:
Xyphyn committed 2023-07-08 15:10:59 -07:00
1 parent 08fce6f023
commit fc240bbae6
3 files changed
+63 -4

No files matched your search

+12
View File
@@ -0,0 +1,12 @@
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()
})
})