Skip to content

Commit

Permalink
✅ update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Harley Alexander committed Aug 26, 2019
1 parent e75666a commit fa564ba
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
1 change: 1 addition & 0 deletions src/PusherProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function PusherProvider({
triggerEndpoint
}}
children={children}
{...props}
/>
);
}
2 changes: 1 addition & 1 deletion src/__tests__/useChannel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ describe("useChannel hook", () => {
<PusherProvider
{...config}
children={children}
value={{ client: { current: undefined }, triggerEndpoint: "d" }}
value={{ client: { current: undefined }, triggerEndpoint: "-" }}
/>
);
const { result, rerender } = renderHook(() => useChannel("my-channel"), {
Expand Down
1 change: 1 addition & 0 deletions src/useChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ export function useChannel(channelName: string) {
const channel = pusherClient.subscribe(channelName);
setChannel(channel);
}, [channelName, pusherClient]);

return channel;
}
4 changes: 2 additions & 2 deletions src/usePresenceChannel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ export function usePresenceChannel<T = any>(channelName: string) {
channel.bind("pusher:member_removed", handleRemove);

// set any members that already existed on the channel
setMembers(channel.members.members);
setMyID(channel.members.myID);
channel.members && setMembers(channel.members.members);
channel.members && setMyID(channel.members.myID);
}

// cleanup
Expand Down

0 comments on commit fa564ba

Please sign in to comment.