2023-05-31 03:08:49 +02:00
|
|
|
import {LikelyType, getLikelyType} from '../../src/lib/link-meta/link-meta'
|
2022-12-22 16:32:39 +01:00
|
|
|
|
|
|
|
describe('getLikelyType', () => {
|
|
|
|
it('correctly handles non-parsed url', async () => {
|
|
|
|
const output = await getLikelyType('https://example.com')
|
|
|
|
expect(output).toEqual(LikelyType.HTML)
|
|
|
|
})
|
|
|
|
|
|
|
|
it('handles non-string urls without crashing', async () => {
|
|
|
|
const output = await getLikelyType('123')
|
|
|
|
expect(output).toEqual(LikelyType.Other)
|
|
|
|
})
|
|
|
|
})
|