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

Fetch: add tests for Response.json #32825

Merged

Conversation

lucacasonato
Copy link
Member

@lucacasonato lucacasonato commented Feb 11, 2022

Spec change: whatwg/fetch#1392

fetch/api/response/response-static-json.any.js Outdated Show resolved Hide resolved
fetch/api/response/response-static-json.any.js Outdated Show resolved Hide resolved
fetch/api/response/response-static-json.any.js Outdated Show resolved Hide resolved
fetch/api/response/response-static-json.any.js Outdated Show resolved Hide resolved
fetch/api/response/response-static-json.any.js Outdated Show resolved Hide resolved
fetch/api/response/response-static-json.any.js Outdated Show resolved Hide resolved
@mnot mnot removed their request for review February 17, 2022 22:14
Copy link
Member

@annevk annevk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These look great.

(Optional nit: for INIT_TESTS it might be clearer if you prefix the expectation variables in the for loop with "expected", e.g., "expectedStatus".)

Copy link
Contributor

@ricea ricea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there should be a test for a circular structure like

let a = {};
a.a = a;

@lucacasonato
Copy link
Member Author

@ricea Added.

@lucacasonato
Copy link
Member Author

I'd like to land these tests so I can ship this feature in Deno in our canary branch. Any objections? Should I mark them "tenative" until the spec PR lands?

@ricea
Copy link
Contributor

ricea commented May 12, 2022

Yes, fine to land as "tentative" if you're willing to rename them later.

@annevk annevk merged commit 27e770b into web-platform-tests:master May 18, 2022
annevk pushed a commit to whatwg/fetch that referenced this pull request May 18, 2022
A method that can be used to create well-formed JSON responses with very little effort.

The JSON response is not pretty printed.

Tests: web-platform-tests/wpt#32825.

Closes #1389.
aarongable pushed a commit to chromium/chromium that referenced this pull request Jun 30, 2022
This commit adds support for the `Response.json` static method as
specified in whatwg/fetch#1392.

All WPTs from web-platform-tests/wpt#32825 pass.

Bug: 1305358
Change-Id: Iaafdd514ed12644b6433c02e7d076ce43f51b9ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3639064
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1019479}
mjfroman pushed a commit to mjfroman/moz-libwebrtc-third-party that referenced this pull request Oct 14, 2022
This commit adds support for the `Response.json` static method as
specified in whatwg/fetch#1392.

All WPTs from web-platform-tests/wpt#32825 pass.

Bug: 1305358
Change-Id: Iaafdd514ed12644b6433c02e7d076ce43f51b9ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3639064
Reviewed-by: Yutaka Hirano <yhirano@chromium.org>
Reviewed-by: Adam Rice <ricea@chromium.org>
Commit-Queue: Yutaka Hirano <yhirano@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1019479}
NOKEYCHECK=True
GitOrigin-RevId: e680cd1bf0f99e44102f8714dcb5f77fba82c5ed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants