Skip to content

Commit

Permalink
Fix type of FakeMessageChannel
Browse files Browse the repository at this point in the history
so that the type system thinks it's a drop in replacement for MessageChannel
  • Loading branch information
hoodmane committed May 16, 2023
1 parent a02478c commit cd44c9b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/fake_message_channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class FakeMessagePort {
}
}

export class FakeMessageChannel {
class FakeMessageChannel {
port1: FakeMessagePort;
port2: FakeMessagePort;
constructor() {
Expand All @@ -42,3 +42,8 @@ export class FakeMessageChannel {
this.port2._otherPort = this.port1;
}
}

let FakeMessageChannel1 =
FakeMessageChannel as unknown as typeof MessageChannel;

export { FakeMessageChannel1 as FakeMessageChannel };

0 comments on commit cd44c9b

Please sign in to comment.