angular-docs-cn/packages/service-worker/worker/testing
George Kalpakas 5306330d85 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
2019-06-27 09:52:28 -07:00
..
BUILD.bazel build: rules_nodejs 0.26.0 & use @npm instead of @ngdeps now that downstream angular build uses angular bundles (#28871) 2019-02-28 12:06:36 -08:00
cache.ts fix(service-worker): do not blow up when caches are unwritable (#26042) 2018-09-24 09:53:39 -07:00
fetch.ts test(service-worker): better simulate opaque requests (#30977) 2019-06-27 09:52:28 -07:00
mock.ts test(service-worker): better simulate opaque requests (#30977) 2019-06-27 09:52:28 -07:00
scope.ts fix(service-worker): registration failed on Safari (#31140) 2019-06-24 14:58:58 -07:00