14 lines
405 B
TypeScript
14 lines
405 B
TypeScript
|
import { validateURL } from 'next/dist/server/app-render/validate-url'
|
||
|
|
||
|
describe('validateUrl', () => {
|
||
|
it('should return valid pathname', () => {
|
||
|
expect(validateURL('/')).toBe('/')
|
||
|
expect(validateURL('/abc')).toBe('/abc')
|
||
|
})
|
||
|
|
||
|
it('should throw for invalid pathname', () => {
|
||
|
expect(() => validateURL('//**y/\\')).toThrow()
|
||
|
expect(() => validateURL('//google.com')).toThrow()
|
||
|
})
|
||
|
})
|