Repository navigation
Export constants for ReadyState in websockets module - #6306
Merged
Merged
Conversation
janHildebrandt98
requested review from
ankur22 and
joanlopez
and removed request for
a team
August 17, 2026 10:14
janHildebrandt98
temporarily deployed
to
azure-trusted-signing
August 17, 2026 10:27 — with
GitHub Actions
Inactive
janHildebrandt98
temporarily deployed
to
azure-trusted-signing
August 17, 2026 10:29 — with
GitHub Actions
Inactive
ankur22
approved these changes
Aug 21, 2026
ankur22
left a comment
Contributor
There was a problem hiding this comment.
LGTM ๐
Nit: is there no way to test the closing state in the test?
Contributor
Author
Not sure what you mean :) But I though the existing tests were sufficient. I changed them to use the new constants so we ensure the constants actually work as well |
joanlopez
approved these changes
Aug 25, 2026
This was referenced Sep 10, 2026
inancgumus
added a commit
to grafana/k6-docs
that referenced
this pull request
Sep 16, 2026
* docs: add WebSocket ready-state documentation Adds connection-state constants and an example for checking them. Related: grafana/k6#6306 * docs: clarify WebSocket state comparisons Direct users to browser-compatible constants instead of a runtime enum\nthat k6 does not export. * docs: remove unused WebSocket enum guidance Keep connection-state guidance focused on the supported constants.
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What?
Exports constants for the
ReadyStatevalues on bothWebSocketconstructor and instances following the spec.Why?
Replaces the previously, wrongly advertised (by the typedefs) enum.
Aligns our implementation with what user are used to from the browser.
Checklist
make check) and all pass.Related PR(s)/Issue(s)
PR in grafana/k6-DefinitelyTyped: grafana/k6-DefinitelyTyped#120
Issue was also described in #4540