mirror of
https://github.com/streamwall/streamwall.git
synced 2026-01-27 23:42:49 -05:00
Makes control.js testable with various config. changes. Adds coverage for util.js, roles.js, starts on control.js. Updates the entrypoint; untested so far
This commit is contained in:
17
src/util.test.js
Normal file
17
src/util.test.js
Normal file
@@ -0,0 +1,17 @@
|
||||
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()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user