summaryrefslogtreecommitdiff
path: root/js/fetch_test.ts
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2019-01-17 16:58:06 -0500
committerRyan Dahl <ry@tinyclouds.org>2019-01-17 17:33:50 -0500
commitd787713908c89829903d8201acf56c153ac656d8 (patch)
tree885d6ab352a21a7f2a6423b0b213d7b0667500f9 /js/fetch_test.ts
parentf19622e7681b7753788137706e535f72c3ebb38e (diff)
Revert "fix: fix fetch tests (#1535)"
This reverts commit dd081655280243ad6c1e6b99599424f21c3aa456. These tests are still flaky: https://travis-ci.com/denoland/deno/jobs/171240240 https://travis-ci.com/denoland/deno/jobs/170775382
Diffstat (limited to 'js/fetch_test.ts')
-rw-r--r--js/fetch_test.ts25
1 files changed, 21 insertions, 4 deletions
diff --git a/js/fetch_test.ts b/js/fetch_test.ts
index bff94420b..582f92839 100644
--- a/js/fetch_test.ts
+++ b/js/fetch_test.ts
@@ -135,6 +135,26 @@ testPerm({ net: true }, async function fetchInitBlobBody() {
assert(response.headers.get("content-type").startsWith("text/javascript"));
});
+// TODO(ry) The following tests work but are flaky. There's a race condition
+// somewhere. Here is what one of these flaky failures looks like:
+//
+// test fetchPostBodyString_permW0N1E0R0
+// assertEqual failed. actual = expected = POST /blah HTTP/1.1
+// hello: World
+// foo: Bar
+// host: 127.0.0.1:4502
+// content-length: 11
+// hello world
+// Error: actual: expected: POST /blah HTTP/1.1
+// hello: World
+// foo: Bar
+// host: 127.0.0.1:4502
+// content-length: 11
+// hello world
+// at Object.assertEqual (file:///C:/deno/js/testing/util.ts:29:11)
+// at fetchPostBodyString (file
+
+/*
function bufferServer(addr: string): deno.Buffer {
const listener = deno.listen("tcp", addr);
const buf = new deno.Buffer();
@@ -167,7 +187,6 @@ testPerm({ net: true }, async function fetchRequest() {
});
assertEqual(response.status, 404);
assertEqual(response.headers.get("Content-Length"), "2");
- await response.blob();
const actual = new TextDecoder().decode(buf.bytes());
const expected = [
@@ -190,14 +209,12 @@ testPerm({ net: true }, async function fetchPostBodyString() {
});
assertEqual(response.status, 404);
assertEqual(response.headers.get("Content-Length"), "2");
- await response.blob();
const actual = new TextDecoder().decode(buf.bytes());
const expected = [
"POST /blah HTTP/1.1\r\n",
"hello: World\r\n",
"foo: Bar\r\n",
- "content-type: text/plain;charset=UTF-8\r\n",
`host: ${addr}\r\n`,
`content-length: ${body.length}\r\n\r\n`,
body
@@ -217,7 +234,6 @@ testPerm({ net: true }, async function fetchPostBodyTypedArray() {
});
assertEqual(response.status, 404);
assertEqual(response.headers.get("Content-Length"), "2");
- await response.blob();
const actual = new TextDecoder().decode(buf.bytes());
const expected = [
@@ -230,3 +246,4 @@ testPerm({ net: true }, async function fetchPostBodyTypedArray() {
].join("");
assertEqual(actual, expected);
});
+*/