Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stringify lists in the ChannelTest module #5576

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

Gazler
Copy link
Member

@Gazler Gazler commented Sep 13, 2023

When testing with channels, map keys are stringified to replicate what would happen in the browser. This allows a test such as:

push(socket, "topic", %{foo: "bar"})

The ChannelTest module will modify this to reflect a real client, resulting in the channel receiving:

%{"foo" => "bar"}

This commit also includes arrays, making the behaviour consistent when pushing data containing an array.

This closes #5423

When testing with channels, map keys are stringified to replicate what
would happen in the browser. This allows a test such as:

    push(socket, "topic", %{foo: "bar"})

The ChannelTest module will modify this to reflect a real client,
resulting in the channel receiving:

    %{"foo" => "bar"}

This commit also includes arrays, making the behaviour consistent when
pushing data containing an array.
@Gazler Gazler merged commit dd7e1e2 into phoenixframework:main Sep 13, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

channel_test doesn't stringify within arrays
2 participants