mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-25 14:42:48 -05:00
17 lines
614 B
JavaScript
17 lines
614 B
JavaScript
import { ensureValidURL } from './util'
|
|
|
|
describe('ensureValidURL', () => {
|
|
it('should not throw an error for valid http and https URLs', () => {
|
|
expect(() => ensureValidURL('http://example.com')).not.toThrow()
|
|
expect(() => ensureValidURL('https://example.com')).not.toThrow()
|
|
})
|
|
|
|
it('should throw an error for non-http and non-https URLs', () => {
|
|
expect(() => ensureValidURL('ftp://example.com')).toThrow()
|
|
expect(() => ensureValidURL('file://example.com')).toThrow()
|
|
})
|
|
|
|
it('should throw an error for invalid URLs', () => {
|
|
expect(() => ensureValidURL('invalid')).toThrow()
|
|
})
|
|
}) |