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 Apr 11, 2023
1 parent a02478c commit 9fb238e
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions 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 @@ -41,4 +41,8 @@ export class FakeMessageChannel {
this.port1._otherPort = this.port2;
this.port2._otherPort = this.port1;
}
}
};

let FakeMessageChannel1 = FakeMessageChannel as unknown as typeof MessageChannel;

export { FakeMessageChannel1 as FakeMessageChannel};

0 comments on commit 9fb238e

Please sign in to comment.