feat: Add some more tests
This commit is contained in:
1 parent
08fce6f023
commit
fc240bbae6
3 files changed
+63
-4
No files matched your search
@@ -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()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user