unfetch
unfetch copied to clipboard
Run GitHub/fetch tests against this polyfill
I did try putting together a PR that runs all tests at github/fetch but got overwhelmed by amount of work required. Basically it should be done via Git submodules and a shell/node script that swaps the implementation in the submodule with dist of this project.
Doing most of things manually I saw a few tests failing.
Sound good. We will definitely need to selectively ignore some tests though.
Which parts you think it should fail?
unfetch intentionally doesn't recreate the Headers or Response classes, instead using POJO's for them to shave bytes (so those tests should all fail). The rest are just size tradeoffs - I was on the fence about even supporting Response#xml() and Response#blob(), but the size bump was minimal (10b) for them. To me, unfetch is best kept as a bare minimum feature set: loosely emulating the fetch() API semantics but allowing the same userland usage so that it remains transparent for the 99% case. Anything that falls under the umbrella seems like fair game.