various bugfixes
This commit is contained in:
12
tests/defaultSite.test.mjs
Normal file
12
tests/defaultSite.test.mjs
Normal file
@ -0,0 +1,12 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { defaultSite } from '../build/defaultSite.mjs'
|
||||
|
||||
test('default site supports the demo and configurable site paths without embedding credentials', () => {
|
||||
assert.equal(defaultSite(), 'https://ttp.joeykimsey.com')
|
||||
assert.equal(defaultSite(' https://site.test/ttp/ '), 'https://site.test/ttp')
|
||||
assert.equal(defaultSite('http://192.168.1.194:8024/'), 'http://192.168.1.194:8024')
|
||||
for (const value of ['', 'not a url', 'file:///C:/test', 'https://user:secret@site.test/', 'https://site.test/?token=secret', 'https://site.test/#login']) {
|
||||
assert.throws(() => defaultSite(value))
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user