Skip to content

Commit f3902b9

Browse files
authored
Merge pull request #3316 from codecrafters-io/test-invoke-onconnect-callback
test: call onConnect callback when subscribing
2 parents 100d070 + d46b2da commit f3902b9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

tests/support/fake-action-cable-consumer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export default class FakeActionCableConsumer {
3535
this.#subscriptions[channel] ||= [];
3636
this.#subscriptions[channel] = [...this.#subscriptions[channel], { id, args, callbacks }];
3737

38+
if (callbacks.onConnect) {
39+
callbacks.onConnect();
40+
}
41+
3842
return {
3943
send: () => {},
4044
unsubscribe: () => {

0 commit comments

Comments
 (0)