silverwolf-x's picture
download
raw
1.57 kB
import { isDynamicRoute } from './is-dynamic'
describe('isDynamicRoute', () => {
describe('strict', () => {
it('should return true for dynamic routes', () => {
expect(isDynamicRoute('/blog/[...slug]')).toBe(true)
})
it('should return false for static routes', () => {
expect(isDynamicRoute('/blog/123')).toBe(false)
})
it('should return true for dynamic routes with a suffix', () => {
expect(isDynamicRoute('/blog/[slug].json')).toBe(false)
})
it('should return false for dynamic routes with a prefix', () => {
expect(isDynamicRoute('/blog/$d$slug$[...slug]/')).toBe(false)
})
it('should return false for dynamic routes with a suffix and prefix', () => {
expect(isDynamicRoute('/blog/$d$slug$[...slug].json')).toBe(false)
})
})
describe('non-strict', () => {
it('should return true for dynamic routes', () => {
expect(isDynamicRoute('/blog/[...slug]', false)).toBe(true)
})
it('should return false for static routes', () => {
expect(isDynamicRoute('/blog/123', false)).toBe(false)
})
it('should return true for dynamic routes with a suffix', () => {
expect(isDynamicRoute('/blog/[slug].json', false)).toBe(true)
})
it('should return true for dynamic routes with a prefix', () => {
expect(isDynamicRoute('/blog/$d$slug$[...slug]/', false)).toBe(true)
})
it('should return true for dynamic routes with a suffix and prefix', () => {
expect(isDynamicRoute('/blog/$d$slug$[...slug].json', false)).toBe(true)
})
})
})

Xet Storage Details

Size:
1.57 kB
·
Xet hash:
506e18facfbce1f210163e264b5507b4f3ad5ba285c5c8c64bd8dfbf69976e56

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.