chore: migrate to nuxt-vitest
This commit is contained in:
parent
b48b7f4c16
commit
6dbf7ae74f
12 changed files with 619 additions and 102 deletions
23
tests/unit/permalinks.test.ts
Normal file
23
tests/unit/permalinks.test.ts
Normal file
|
@ -0,0 +1,23 @@
|
|||
import { describe, expect, it } from 'vitest'
|
||||
import { HANDLED_MASTO_URLS } from '~/constants'
|
||||
|
||||
const validPermalinks = [
|
||||
'https://m1as-social34.to.social/@elk',
|
||||
'https://m1as-social34.to.social/@elk22/123',
|
||||
'https://m1as-social34.to.social/@elk22/objects/123',
|
||||
'webtoo.ls/@elk',
|
||||
]
|
||||
|
||||
const invalidPermalinks = [
|
||||
'https://webtoo.ls',
|
||||
'https://webtoo.ls/elk/123',
|
||||
]
|
||||
|
||||
describe('permalinks', () => {
|
||||
it.each(validPermalinks)('should recognise %s', (url) => {
|
||||
expect(HANDLED_MASTO_URLS.test(url)).toBe(true)
|
||||
})
|
||||
it.each(invalidPermalinks)('should not recognise %s', (url) => {
|
||||
expect(HANDLED_MASTO_URLS.test(url)).toBe(false)
|
||||
})
|
||||
})
|
Loading…
Add table
Add a link
Reference in a new issue