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

238 Коммитов

Автор SHA1 Сообщение Дата
Nikhil Marathe b917855658 Merge branch 'master' of github.com:nikhilm/fetch 2015-01-15 14:21:11 -08:00
Nikhil Marathe 7d6cac27bc Fetch spec requires non-omit credentials mode to set cookies too.
https://fetch.spec.whatwg.org/#concept-http-network-or-cache-fetch step 13, requires credentials flag to be set to accept cookies
2015-01-15 14:19:24 -08:00
Joshua Peek fbfa9e3320 Fix up body consuming on request 2015-01-15 14:18:21 -08:00
Joshua Peek 42ce689351 Test bodyUsed prop 2015-01-15 13:20:56 -08:00
Joshua Peek 7474e42af4 Add charset content-type tests 2015-01-15 12:21:58 -08:00
Joshua Peek 9d586486e5 Add additional body init and consume test coverage 2015-01-13 19:47:01 -08:00
Joshua Peek e7c9e29f14 Fix blob feature check 2015-01-12 16:04:38 -08:00
Joshua Peek ebdd0d8ae9 Support blob and string BodyInit 2015-01-12 16:02:58 -08:00
Joshua Peek 7436589761 Tidy up binary file reader 2015-01-12 15:47:12 -08:00
Joshua Peek 1b84d7b270 Merge branch 'blob-binary-data' of https://github.com/lrowe/fetch into lrowe-blob-binary-data 2015-01-12 15:20:26 -08:00
Joshua Peek 5c3efc9ded IE9/10/11 don't support 308 2015-01-12 15:07:45 -08:00
Laurence Rowe 77dd2e61f8 Extend non-ascii test to cover bytes 0-255 2015-01-11 18:46:21 -08:00
Laurence Rowe c99de80930 Tidy up from feedback
* Use Blob feature detection to work with phantomjs.
* Avoid creating new promises unnecessarily.
* Fix condition for arrayBuffer test suite.
2015-01-11 18:38:35 -08:00
Laurence Rowe eeb53d391d Use responseText on IE9 which lacks XHR2 support 2015-01-11 17:49:30 -08:00
Laurence Rowe 170a76d27a Add support for arrayBuffer 2015-01-11 17:49:30 -08:00
Laurence Rowe 080358ddb2 Use `xhr.responseType = 'blob'` to preserve binary data.
This adds a requirement for XMLHTTPRequest2 (IE10.)
2015-01-11 17:49:30 -08:00
Laurence Rowe 49907c8640 Test demonstrating blob does not handle non-ascii data correctly. 2015-01-11 17:49:30 -08:00
Laurence Rowe 734106e669 Make Headers case insensitive though lowercasing.
This implementation is not case preserving when iterating over a Headers object.
2015-01-10 22:46:38 -08:00
Joshua Peek 33d47f4493 Merge branch 'master' into test-cookies 2015-01-10 19:14:24 -08:00
Joshua Peek acac0fbb31 Test in web worker
Closes #51
2015-01-10 19:02:46 -08:00
Joshua Peek 05bce93dc6 Nah, leaks 2015-01-10 17:57:31 -08:00
Joshua Peek ecd8600932 Group tests 2015-01-10 17:56:15 -08:00
Joshua Peek 8a4b62027e Skip tests in phantomjs 2015-01-10 17:47:51 -08:00
Joshua Peek 8cd05deb58 Use assert.match 2015-01-10 17:41:27 -08:00
Joshua Peek 84c3a0e70d Disable URL in phantomjs for now 2015-01-10 17:27:33 -08:00
Joshua Peek aaa5b24cc6 Group redirect test 2015-01-10 17:26:52 -08:00
Joshua Peek d215ce741c Allow suite 2015-01-10 17:25:58 -08:00
Joshua Peek 50211838e3 Group Blob and FormData tests 2015-01-10 17:25:28 -08:00
Joshua Peek cbd6c66fe4 Switch to mocha 2015-01-10 17:14:16 -08:00
Joshua Peek 2c61395ed7 Add X-Request-URL 2015-01-10 16:25:22 -08:00
Joshua Peek 304f405442 Test Response#url 2015-01-06 11:25:56 -08:00
Joshua Peek 1bbe6f0ef1 Default credentials to 'omit' 2015-01-05 19:26:47 -08:00
Joshua Peek af17642c41 No contraction 2015-01-05 19:13:28 -08:00
Joshua Peek 68d86d0549 Test credentials options 2015-01-05 16:13:44 -08:00
Joshua Peek 3dab4c2d4a Skip 308 redirect in PhantomJS 2015-01-05 15:46:05 -08:00
Joshua Peek 7efe0a5013 Test Atomic HTTP redirect handling
https://fetch.spec.whatwg.org/#atomic-http-redirect-handling
2015-01-05 15:39:00 -08:00
Joshua Peek 7e67f696f6 Allow headers in tests 2015-01-05 15:25:27 -08:00
Joshua Peek 6a472bbca5 Feature check FormData support on Response 2015-01-05 15:18:32 -08:00
Joshua Peek dfb85f5e6c Allow promiseTest 2015-01-05 15:09:17 -08:00
Joshua Peek 5ba745161f Add promise test helper 2015-01-05 15:06:03 -08:00
Joshua Peek 1898d56433 Add worker to test lint config 2014-12-29 12:29:39 -06:00
Joshua Peek cc4215367d Avoid testing implementation specific error messages 2014-12-19 12:43:06 -08:00
Joshua Peek e4142843fa Align bodyUsed error message to Chrome's implementation 2014-12-18 15:41:04 -08:00
David Graham 4a7e655b4f Test formData body consumption. 2014-11-24 11:35:55 -07:00
David Graham 67152c2a7e Reject promise with TypeError for network failures. 2014-11-20 17:38:45 -07:00
David Graham 7ac990f728 Posting object literal as request body is not supported.
See #30 for details.
2014-11-12 19:25:14 -07:00
David Graham 7f98350df8 Don't reference response.body directly.
Previously renamed to _body to detect these types of errors.
2014-11-12 19:20:29 -07:00
David Graham ddf7a7dc38 Merge remote-tracking branch 'origin/master' into ie-fixes
Conflicts:
	fetch.js
2014-11-12 18:56:04 -07:00
David Graham bea0310bb5 Remove object form encoding test. 2014-11-01 18:03:11 -06:00
David Graham 531c68f04b Remove old body property references.
The body must be consumed through the `text`, `json`, `formData`, or
`blob` functions.
2014-11-01 17:57:43 -06:00
David Graham a1c1b79abf Fix form post content type test. 2014-11-01 17:50:22 -06:00
Mislav Marohnić d5a000df93 Fixes 204 No Content responses for IE 9
IE 9 fails on 204s with error code 1223
http://www.enhanceie.com/ie/bugs.asp

Rewrite the code back to 204. Note: response headers remain unavailable
in this case. This was fixed in IE 10.
2014-10-31 13:57:21 +01:00
Mislav Marohnić 5a2d5f860b Fix promise being rejected on IE 9 when server response is invalid
Reject all HTTP codes that are not in the 100..599 range.

When an empty reply is received from the server, `xhr.onerror` callback
should get triggered. IE 9, however, triggers the `onload` callback with
status code 12152 that stands for:

    ERROR_HTTP_INVALID_SERVER_RESPONSE
    The server response could not be parsed.

http://support.microsoft.com/kb/193625
2014-10-31 13:56:29 +01:00
Mislav Marohnić eea856859e Fix test that reads "Date" header on IE
IE caches xhr responses pretty aggressively and after restoring the
previous response from cache, it blanks out the "Date" header (probably
by design). The solution for this test is to use a cache-busting query
parameter.
2014-10-31 13:56:29 +01:00
Mislav Marohnić 6746b891c0 Fix test suite CSS for IE
By default, all static files served from the test server were
"text/plain". IE auto-detects HTML and JavaScript content as such, but
refuses to display the style sheet until it is served as "text/css".
2014-10-31 13:56:29 +01:00
Mislav Marohnić b922decb34 Compensate for the broken PATCH support in PhantomJS
PhantomJS doesn't seem to send request body for PATCH:
https://github.com/ariya/phantomjs/issues/11384
2014-10-31 13:56:29 +01:00
Mislav Marohnić dcc3e82a8d Normalize capitalization of HTTP methods per fetch spec
Now only the whitelisted method names get normalized by uppercasing and
the rest are left untouched since HTTP method names in general are
case-sensitive.

In tests we must use `PATCH` (uppercase) because Node.js server doesn't
support `patch` (lowercase).
2014-10-31 13:56:29 +01:00
Mislav Marohnić c71f1dd9bb Uppercase the HTTP method name
This fixes PUT/DELETE for IE 9 and PATCH for Node.js.
2014-10-31 13:56:01 +01:00
Mislav Marohnić 79f74952cc Auto-detect available port when running headless tests
By default the test server tried to run on port 3000, which would fail
with a misleading message if something else happened to occupy that port
on the system (such as a Rails app).

Now start incrementing the port number from 3900 and stop when the port
is found to be available.
2014-10-30 13:27:49 +01:00
Joshua Peek fc6f4519fc Feature detect blob support 2014-10-16 10:38:53 -07:00
Joshua Peek c02cad221e Skip blob tests on phantom 2014-10-15 18:44:53 -07:00
Joshua Peek 81c857f30f Add basic run script 2014-10-15 18:40:45 -07:00
Joshua Peek ded306d039 Set test timeout 2014-10-15 18:31:08 -07:00
Joshua Peek 11fb87ed27 Fix duplicate content type 2014-10-15 18:22:56 -07:00
Joshua Peek 503786ce7b Move under test 2014-10-15 18:20:40 -07:00
Joshua Peek c568f1affb Test server connection error 2014-10-15 18:18:36 -07:00
Joshua Peek 3316bdaf03 Add test server 2014-10-15 16:06:40 -07:00
Joshua Peek e61377fecb Allow sub lint in tests 2014-10-15 15:40:26 -07:00
Joshua Peek 6f6239927b No need for es3 for tests 2014-10-15 15:38:01 -07:00
Zirak e428559a68 Fixed uncaught error when a body was consumed more than once.
Ammended tets to also check error message, not just type.
2014-10-15 23:45:25 +03:00
David Graham 66c4948586 Merge pull request #8 from github/form-data
Parse form encoded response body
2014-10-15 10:19:55 -06:00
David Graham 60271cef8a Parse form encoded response body. 2014-10-14 21:48:49 -06:00
David Graham c7a27dc12f Allow body to be consumed a single time. 2014-10-14 20:35:24 -06:00
David Graham ce9abcced4 Test network failure rejects promise. 2014-10-13 15:25:01 -06:00
David Graham 9bdada53c3 Test promise is resolved for non-200 response. 2014-10-13 15:23:25 -06:00
David Graham ef2ce741b0 Missed a var. 2014-10-13 15:12:04 -06:00
David Graham 219bda9abe Test response header parsing. 2014-10-13 15:11:19 -06:00
David Graham 41b622d922 Respond with optional headers. 2014-10-13 15:10:58 -06:00
David Graham a2331840be Remove unused parameters. 2014-10-13 14:56:00 -06:00
David Graham d7273325c2 Test post content-type header. 2014-10-13 14:53:36 -06:00
David Graham 3bca288404 Test posted form data encoding. 2014-10-13 14:50:59 -06:00
David Graham 585453bd8f Test request headers. 2014-10-13 14:48:53 -06:00
David Graham 8c18ecc54a Test get method. 2014-10-13 14:48:38 -06:00
David Graham c38cfe25fc Track mock requests. 2014-10-13 14:48:21 -06:00
David Graham affb781dcd Test blob promise. 2014-10-13 14:28:30 -06:00
David Graham df0f9bb586 Add text promise test. 2014-10-13 14:25:12 -06:00
David Graham f95e98c8c5 Add json tests. 2014-10-13 14:23:45 -06:00
David Graham 44e796a874 Start tests. 2014-10-12 18:22:45 -06:00