Граф коммитов

238 Коммитов

Автор SHA1 Сообщение Дата
Jake Champion f7e3e92058 fix: Headers only accepts array which have nested array of length 2
fixes https://github.com/JakeChampion/fetch/issues/1235
2023-07-18 01:28:16 +01:00
Jake Champion 7d92dff12d fix: when no body supplied, do not set bodyUsed to true 2023-07-18 00:04:44 +01:00
Jake Champion 0c1d2b97b7 validate status is in range
fixes https://github.com/JakeChampion/fetch/issues/1213
2023-07-17 23:44:20 +01:00
Jake Champion e3f6590792 remove invalid-headers test 2023-07-17 23:28:03 +01:00
Jake Champion 408d3b60e2 dont use github eslint 2023-07-17 23:28:03 +01:00
Philipp Kursawe 9a6d748b39 fix: ignore not throw on invalid response headers
Fixes #930
2023-04-01 02:40:08 +01:00
romainmenke d1d09fb803 always set a signal on Request 2021-08-02 12:03:23 +01:00
Juan Aguilar Santillana 7e926ebf61 Fix unused eslint-disable attribute 2021-02-17 17:51:10 +00:00
Tanguy Krotoff b5c8bd0fee Fix statusText: undefined should give '' and null should give 'null' 2021-01-28 12:09:17 +00:00
Jake Champion 5ef028d61f Throw a TypeError if Request or Response functions are called without `new` 2020-07-09 16:25:14 +01:00
Jake Champion 8065fdddc3
Fix prettier to version 1 2020-05-27 11:37:45 +01:00
Roman Yakubuk 66065840c9
Change default statusText for Response (#698)
* Change default statusText for Response

* Cleanup test descriptions. Remove redundant tests.

* Remove checking old behavior for statusText default value
2020-05-27 10:32:13 +01:00
justjavac 96b37eb63e
field name can not by empty 2018-12-29 09:47:14 +08:00
Mislav Marohnić 1821b74b80 Compatibility with newer eslint-plugin-github 2018-12-06 13:10:56 +01:00
Mislav Marohnić 0ae0da370e
Merge pull request #651 from github/body-unsupported-type
Match spec behavior re: unsupported body type
2018-09-04 12:06:58 +02:00
Mislav Marohnić 74a873ad02 Fix worker config 2018-09-03 22:20:53 +02:00
Mislav Marohnić 4f4de0564b Avoid running Chromium in CI
It seems like it's outdated:
https://travis-ci.org/github/fetch/builds/424048996
2018-09-03 22:16:03 +02:00
Mislav Marohnić 66768e0aae Bring back `--no-sandbox` for Travis CI compatibility 2018-09-03 21:04:14 +02:00
Mislav Marohnić f0ebccf7fe Prefer headless testing 2018-09-03 20:48:03 +02:00
Mislav Marohnić 08bc7423c9 Match spec behavior re: unsupported body type
The polyfill used to throw an exception, but the spec dictates that
unsupported body types are simply converted to string.

Closes #576
2018-09-03 20:03:54 +02:00
Mislav Marohnić e59da3c703 Remove unnecessary test assertions
This was only useful while debugging cache issues.
2018-09-03 19:52:42 +02:00
Mislav Marohnić f1657b086f Use karma-detect-browsers to make things simpler 2018-09-03 19:02:24 +02:00
Mislav Marohnić 7d6198aec7 Skip test for `credentials` default on Safari
In Safari 11.1.2, the default for `credentials` is still "omit".
2018-09-03 18:27:23 +02:00
Mislav Marohnić 3a8e6e44e3 Automatically test with Safari on macOS 2018-09-03 18:08:26 +02:00
Mislav Marohnić 4c5f227753 Change `credentials` default value: `omit` → `same-origin`
https://github.com/whatwg/fetch/pull/585
2018-07-25 15:37:27 +02:00
Mislav Marohnić 0ee11fa3cf Avoid Node 6 deprecation warnings re: Buffer
https://nodejs.org/api/buffer.html#buffer_buffer_from_buffer_alloc_and_buffer_allocunsafe
2018-05-25 17:59:10 +02:00
Mislav Marohnić 418b8ee260 Enable AbortController polyfill in web worker mode
This should help Firefox 56 in CI which doesn't have AbortController.
2018-05-25 00:47:18 +02:00
Mislav Marohnić 8be5431591 Configure eslint for node 2018-05-24 03:41:10 +02:00
Mislav Marohnić 36c5203bbd Have test output in CI be less noisy 2018-05-24 03:40:29 +02:00
Mislav Marohnić 5826cfc5fa Skip iterable tests broken in Firefox <= 56 2018-05-24 03:35:14 +02:00
Mislav Marohnić 621b80de2c Skip `response.formData()` test in native Safari/Edge
Just like in Chrome, this isn't supported natively.
2018-05-24 03:02:51 +02:00
Mislav Marohnić 47d9084e69 Skip testing functionality that doesn't seem implemented in IE/Edge 2018-05-24 03:02:51 +02:00
Mislav Marohnić 711ab2faac Fix abortable tests in Safari
Safari aggressively caches `/slow` endpoint after first load and serves
it up really fast on subsequent runs, not giving it enough time to
invoke `controller.abort()`.

Adding `Cache-Control` response headers from the server doesn't work.
Safari still serves `/slow` from disk cache, even though `/slow` was
never even allowed to finish on prior runs. My guess is that Safari
erroneously caches the result of `/slow` when the initial request was
aborted.
2018-05-24 03:02:51 +02:00
Mislav Marohnić 837cac40b2 Only test native abortable functionality in browsers that implement it 2018-05-24 02:51:07 +02:00
Mislav Marohnić 3f420d57bd Remove PhantomJS artifacts from tests 2018-05-24 02:51:07 +02:00
Mislav Marohnić f75e24bf62 Load polyfills for testing older browsers 2018-05-24 02:51:07 +02:00
Mislav Marohnić b7ea5f2c38 Remove test that depends on specific abortcontroller-polyfill API
`signal.listeners` is not available in native implementations of AbortSignal.
2018-05-24 02:51:07 +02:00
Mislav Marohnić fd151e986a Split header values with `, ` to match other browsers
Chrome and Firefox both split `append`d values with `, `.
2018-05-24 02:51:07 +02:00
Mislav Marohnić a55b7d71ce Nuke old testing setup 2018-05-24 02:51:07 +02:00
Mislav Marohnić 4f097017ca Convert testing fetch under Web Workers to Karma 2018-05-24 02:51:07 +02:00
Mislav Marohnić b539589046 Switch from PhantomJS to Karma + Chrome/Firefox for testing 2018-05-24 00:12:26 +02:00
Mislav Marohnić 2bd7f22032 Export DOMException for `instanceof` checks 2018-05-23 16:04:31 +02:00
Mislav Marohnić f03586047c Scope abortcontroller to polyfill only 2018-05-23 15:56:17 +02:00
Mislav Marohnić c31fca91bb Merge remote-tracking branch 'origin/master' into abort-polyfill 2018-05-23 15:53:28 +02:00
Mislav Marohnić f6d8b4d513 Use new exports to clean up test suite preparation
Prior to this change, `test.js` had to be loaded before `fetch.js` so it
can nulify the native implementation of `window.fetch` to force testing
of the polyfill. Now that we have exports from the UMD file, we can
abandon this hack and simply access the exports to juggle between native
and polyfilled versions of the implementation.
2018-05-17 16:22:26 +02:00
Mislav Marohnić 114e2bc770 Quit testing CJS exports directly
First of all, loading our UMD dist file in Node doesn't work due to
usage of `self` within `fetch.js`. Second, we don't need to test
exports, since we trust Rollup doing its job.
2018-05-17 16:21:57 +02:00
Mislav Marohnić 432bf07785 Build UMD dist file with Rollup 2018-05-17 16:21:57 +02:00
Mislav Marohnić 0a5748775d Run test files through prettier 2018-05-17 16:21:57 +02:00
Mislav Marohnić 5d803684fd Have tests pass eslint 2018-05-17 16:21:57 +02:00
Jay Phelps da6e028466 Distribute as UMD 2018-04-09 13:37:46 -04:00