diff options
Diffstat (limited to 'http')
| -rw-r--r-- | http/file_server_test.ts | 8 | ||||
| -rw-r--r-- | http/server_test.ts | 20 |
2 files changed, 14 insertions, 14 deletions
diff --git a/http/file_server_test.ts b/http/file_server_test.ts index 7f2dfd278..15f052e6e 100644 --- a/http/file_server_test.ts +++ b/http/file_server_test.ts @@ -2,7 +2,7 @@ const { readFile, run } = Deno; import { test } from "../testing/mod.ts"; -import { assert, assertEq } from "../testing/asserts.ts"; +import { assert, assertEquals } from "../testing/asserts.ts"; import { BufReader } from "../io/bufio.ts"; import { TextProtoReader } from "../textproto/mod.ts"; @@ -36,12 +36,12 @@ test(async function serveFile() { const res = await fetch("http://localhost:4500/azure-pipelines.yml"); assert(res.headers.has("access-control-allow-origin")); assert(res.headers.has("access-control-allow-headers")); - assertEq(res.headers.get("content-type"), "text/yaml; charset=utf-8"); + assertEquals(res.headers.get("content-type"), "text/yaml; charset=utf-8"); const downloadedFile = await res.text(); const localFile = new TextDecoder().decode( await readFile("./azure-pipelines.yml") ); - assertEq(downloadedFile, localFile); + assertEquals(downloadedFile, localFile); } finally { killFileServer(); } @@ -66,7 +66,7 @@ test(async function serveFallback() { const res = await fetch("http://localhost:4500/badfile.txt"); assert(res.headers.has("access-control-allow-origin")); assert(res.headers.has("access-control-allow-headers")); - assertEq(res.status, 404); + assertEquals(res.status, 404); } finally { killFileServer(); } diff --git a/http/server_test.ts b/http/server_test.ts index 8bba36127..4f1bc1c40 100644 --- a/http/server_test.ts +++ b/http/server_test.ts @@ -7,7 +7,7 @@ const { Buffer } = Deno; import { test } from "../testing/mod.ts"; -import { assertEq } from "../testing/asserts.ts"; +import { assertEquals } from "../testing/asserts.ts"; import { Response, ServerRequest } from "./server.ts"; import { BufReader, BufWriter } from "../io/bufio.ts"; @@ -47,7 +47,7 @@ test(async function responseWrite() { request.w = bufw; await request.respond(testCase.response); - assertEq(buf.toString(), testCase.raw); + assertEquals(buf.toString(), testCase.raw); } }); @@ -59,7 +59,7 @@ test(async function requestBodyWithContentLength() { const buf = new Buffer(enc.encode("Hello")); req.r = new BufReader(buf); const body = dec.decode(await req.body()); - assertEq(body, "Hello"); + assertEquals(body, "Hello"); } // Larger than internal buf @@ -71,7 +71,7 @@ test(async function requestBodyWithContentLength() { const buf = new Buffer(enc.encode(longText)); req.r = new BufReader(buf); const body = dec.decode(await req.body()); - assertEq(body, longText); + assertEquals(body, longText); } }); @@ -96,7 +96,7 @@ test(async function requestBodyWithTransferEncoding() { const buf = new Buffer(enc.encode(chunksData)); req.r = new BufReader(buf); const body = dec.decode(await req.body()); - assertEq(body, shortText); + assertEquals(body, shortText); } // Larger than internal buf @@ -120,7 +120,7 @@ test(async function requestBodyWithTransferEncoding() { const buf = new Buffer(enc.encode(chunksData)); req.r = new BufReader(buf); const body = dec.decode(await req.body()); - assertEq(body, longText); + assertEquals(body, longText); } }); @@ -136,7 +136,7 @@ test(async function requestBodyStreamWithContentLength() { let offset = 0; for await (const chunk of it) { const s = dec.decode(chunk); - assertEq(shortText.substr(offset, s.length), s); + assertEquals(shortText.substr(offset, s.length), s); offset += s.length; } } @@ -153,7 +153,7 @@ test(async function requestBodyStreamWithContentLength() { let offset = 0; for await (const chunk of it) { const s = dec.decode(chunk); - assertEq(longText.substr(offset, s.length), s); + assertEquals(longText.substr(offset, s.length), s); offset += s.length; } } @@ -183,7 +183,7 @@ test(async function requestBodyStreamWithTransferEncoding() { let offset = 0; for await (const chunk of it) { const s = dec.decode(chunk); - assertEq(shortText.substr(offset, s.length), s); + assertEquals(shortText.substr(offset, s.length), s); offset += s.length; } } @@ -212,7 +212,7 @@ test(async function requestBodyStreamWithTransferEncoding() { let offset = 0; for await (const chunk of it) { const s = dec.decode(chunk); - assertEq(longText.substr(offset, s.length), s); + assertEquals(longText.substr(offset, s.length), s); offset += s.length; } } |
