Merge pull request #2 from github/jg/connection-test

Connection test
This commit is contained in:
Jose Garcia 2021-07-28 09:52:58 -04:00 committed by GitHub
commit 4fc27b3ed9

View file

@ -31,3 +31,11 @@ func TestConnectionInvalid(t *testing.T) {
t.Error(err)
}
}
func TestConnectionURI(t *testing.T) {
conn := Connection{"sess-id", "sess-token", "sas", "sb://endpoint/.net/liveshare"}
uri := conn.uri("connect")
if uri != "wss://endpoint/.net:443/$hc/liveshare?sb-hc-action=connect&sb-hc-token=sas" {
t.Errorf("uri is not correct, got: '%v'", uri)
}
}