mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-11-20 03:25:52 +01:00
add unit test
This commit is contained in:
parent
898c1349c9
commit
f0086a76c8
@ -54,3 +54,17 @@ export async function lookupHomeserver(homeserver, request) {
|
||||
}
|
||||
return homeserver;
|
||||
}
|
||||
|
||||
export function tests() {
|
||||
return {
|
||||
"normalizing homeserver": assert => {
|
||||
assert.equal(normalizeHomeserver('matrix.org'), 'https://matrix.org');
|
||||
assert.equal(normalizeHomeserver('matrix.org:8008'), 'https://matrix.org:8008');
|
||||
assert.equal(normalizeHomeserver('https://matrix.org'), 'https://matrix.org');
|
||||
assert.equal(normalizeHomeserver('https://matrix.org:8008'), 'https://matrix.org:8008');
|
||||
assert.equal(normalizeHomeserver('localhost'), 'https://localhost');
|
||||
assert.equal(normalizeHomeserver('http:// invalid'), '');
|
||||
assert.equal(normalizeHomeserver('inv alid'), '');
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user