mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 11:35:04 +01:00
fix typescript error in unit test
This commit is contained in:
parent
bcc8e3a6c1
commit
dd89aab516
@ -21,7 +21,7 @@ function noop (): void {}
|
|||||||
export class NullLogger implements ILogger {
|
export class NullLogger implements ILogger {
|
||||||
public readonly item: ILogItem = new NullLogItem(this);
|
public readonly item: ILogItem = new NullLogItem(this);
|
||||||
|
|
||||||
log(): ILogItem {
|
log(labelOrValues: LabelOrValues): ILogItem {
|
||||||
return this.item;
|
return this.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -37,7 +37,7 @@ export class NullLogger implements ILogger {
|
|||||||
|
|
||||||
forceFinish(): void {}
|
forceFinish(): void {}
|
||||||
|
|
||||||
child(): ILogItem {
|
child(labelOrValues: LabelOrValues): ILogItem {
|
||||||
return this.item;
|
return this.item;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -83,11 +83,11 @@ export class NullLogItem implements ILogItem {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
log(): ILogItem {
|
log(labelOrValues: LabelOrValues): ILogItem {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
set(): ILogItem { return this; }
|
set(labelOrValues: LabelOrValues): ILogItem { return this; }
|
||||||
|
|
||||||
runDetached(_: LabelOrValues, callback: LogCallback<unknown>): ILogItem {
|
runDetached(_: LabelOrValues, callback: LogCallback<unknown>): ILogItem {
|
||||||
new Promise(r => r(callback(this))).then(noop, noop);
|
new Promise(r => r(callback(this))).then(noop, noop);
|
||||||
|
@ -511,7 +511,8 @@ export function tests() {
|
|||||||
feeds: [{purpose: "m.usermedia"}]
|
feeds: [{purpose: "m.usermedia"}]
|
||||||
};
|
};
|
||||||
const roomMember = RoomMember.fromUserId("!abc", "@bruno4:matrix.org", "join");
|
const roomMember = RoomMember.fromUserId("!abc", "@bruno4:matrix.org", "join");
|
||||||
const turnServer = new ObservableValue({});
|
const turnServer = new ObservableValue({}) as ObservableValue<RTCIceServer>;
|
||||||
|
// @ts-ignore
|
||||||
const options = {
|
const options = {
|
||||||
confId: "conf",
|
confId: "conf",
|
||||||
ownUserId: "@foobaraccount2:matrix.org",
|
ownUserId: "@foobaraccount2:matrix.org",
|
||||||
@ -529,7 +530,8 @@ export function tests() {
|
|||||||
const member = new Member(roomMember, callDeviceMembership, options, logger.child("member"));
|
const member = new Member(roomMember, callDeviceMembership, options, logger.child("member"));
|
||||||
member.connect(new MockMedia() as LocalMedia, new MuteSettings(), turnServer, logger.child("connect"));
|
member.connect(new MockMedia() as LocalMedia, new MuteSettings(), turnServer, logger.child("connect"));
|
||||||
// pretend we've already received 3 messages
|
// pretend we've already received 3 messages
|
||||||
member.connection.lastProcessedSeqNr = 2;
|
// @ts-ignore
|
||||||
|
member.connection!.lastProcessedSeqNr = 2;
|
||||||
// send hangup with seq=3, this will enqueue the message because there is no peerCall
|
// send hangup with seq=3, this will enqueue the message because there is no peerCall
|
||||||
// as it's up to @bruno4:matrix.org to send the invite
|
// as it's up to @bruno4:matrix.org to send the invite
|
||||||
const hangup = {
|
const hangup = {
|
||||||
@ -545,7 +547,7 @@ export function tests() {
|
|||||||
"sender_session_id": "s1d5863f41ec5a5",
|
"sender_session_id": "s1d5863f41ec5a5",
|
||||||
"dest_session_id": "s1cece7088b9d35"
|
"dest_session_id": "s1cece7088b9d35"
|
||||||
}
|
}
|
||||||
};
|
} as SignallingMessage<MGroupCallBase>;
|
||||||
member.handleDeviceMessage(hangup, logger.child("handle hangup"));
|
member.handleDeviceMessage(hangup, logger.child("handle hangup"));
|
||||||
// Send an invite with seq=4, this will create a new peer call with a the call id
|
// Send an invite with seq=4, this will create a new peer call with a the call id
|
||||||
// when dequeueing the hangup from before, it'll get ignored because it is
|
// when dequeueing the hangup from before, it'll get ignored because it is
|
||||||
@ -574,9 +576,10 @@ export function tests() {
|
|||||||
"sender_session_id": "s1d5863f41ec5a5",
|
"sender_session_id": "s1d5863f41ec5a5",
|
||||||
"dest_session_id": "s1cece7088b9d35"
|
"dest_session_id": "s1cece7088b9d35"
|
||||||
}
|
}
|
||||||
};
|
} as SignallingMessage<MGroupCallBase>;
|
||||||
member.handleDeviceMessage(invite, logger.child("handle invite"));
|
member.handleDeviceMessage(invite, logger.child("handle invite"));
|
||||||
assert.equal(member.connection.queuedSignallingMessages.length, 0);
|
// @ts-ignore
|
||||||
|
assert.equal(member.connection!.queuedSignallingMessages.length, 0);
|
||||||
// logger.reporters[0].printOpenItems();
|
// logger.reporters[0].printOpenItems();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user