mirror of
https://github.com/openlibrecommunity/olcrtc.git
synced 2026-05-26 07:08:11 +00:00
test(jitsi): guard session type assertions in tests
This commit is contained in:
@@ -198,7 +198,10 @@ func TestBridgeCloseRequestsReconnect(t *testing.T) {
|
||||
}
|
||||
defer func() { _ = sess.Close() }()
|
||||
|
||||
js := sess.(*Session)
|
||||
js, ok := sess.(*Session)
|
||||
if !ok {
|
||||
t.Fatal("sess is not *Session")
|
||||
}
|
||||
var ended string
|
||||
js.SetEndedCallback(func(reason string) { ended = reason })
|
||||
js.SetShouldReconnect(func() bool { return true })
|
||||
@@ -226,7 +229,10 @@ func TestBridgeCloseEndsWhenReconnectDisabled(t *testing.T) {
|
||||
}
|
||||
defer func() { _ = sess.Close() }()
|
||||
|
||||
js := sess.(*Session)
|
||||
js, ok := sess.(*Session)
|
||||
if !ok {
|
||||
t.Fatal("sess is not *Session")
|
||||
}
|
||||
var ended string
|
||||
js.SetEndedCallback(func(reason string) { ended = reason })
|
||||
js.SetShouldReconnect(func() bool { return false })
|
||||
|
||||
Reference in New Issue
Block a user