Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(service-worker): better simulate opaque requests (#30977)
Previously, opaque responses where handled a little differently than other responses from the mock server. More specifically, they were not tracked (so no assertions could be made for them) and their [`Body` mixin][1] methods (such as `arrayBuffer()`, `json()`, `text()`) would throw an error due to `body` being `null`. This commit ensures opaque responses are also captured on the mock server and also changes `Body` mixin methods to better simulate the [spec'd behavior][2]. (These improvements will be necessary to test caching of opaque responses in a subsequent commit.) [1]: https://developer.mozilla.org/en-US/docs/Web/API/Body [2]: https://fetch.spec.whatwg.org/#concept-body-consume-body PR Close #30977
- Loading branch information
Showing
2 changed files
with
18 additions
and
29 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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