diff options
author | Casper Beyer <caspervonb@pm.me> | 2020-06-06 11:43:00 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-05 23:43:00 -0400 |
commit | ed5aedc6b4a1d72208649afd8793e288d94021b1 (patch) | |
tree | f5039c94c2a4d03182a5b97dbc0471a1b3123eb1 /std/examples/tests | |
parent | c137b11abfb946ef72a5fcb27e11e0b286a33be3 (diff) |
Rename abbreviated assertions in std/testing (#6118)
Diffstat (limited to 'std/examples/tests')
-rw-r--r-- | std/examples/tests/cat_test.ts | 4 | ||||
-rw-r--r-- | std/examples/tests/catj_test.ts | 10 | ||||
-rw-r--r-- | std/examples/tests/colors_test.ts | 4 | ||||
-rw-r--r-- | std/examples/tests/curl_test.ts | 4 | ||||
-rw-r--r-- | std/examples/tests/echo_server_test.ts | 6 | ||||
-rw-r--r-- | std/examples/tests/welcome_test.ts | 4 | ||||
-rw-r--r-- | std/examples/tests/xeval_test.ts | 4 |
7 files changed, 18 insertions, 18 deletions
diff --git a/std/examples/tests/cat_test.ts b/std/examples/tests/cat_test.ts index 4633c5750..8fb124460 100644 --- a/std/examples/tests/cat_test.ts +++ b/std/examples/tests/cat_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { assertStrictEq } from "../../testing/asserts.ts"; +import { assertStrictEquals } from "../../testing/asserts.ts"; Deno.test("[examples/cat] print multiple files", async () => { const decoder = new TextDecoder(); @@ -19,7 +19,7 @@ Deno.test("[examples/cat] print multiple files", async () => { try { const output = await process.output(); const actual = decoder.decode(output).trim(); - assertStrictEq(actual, "Hello\nWorld"); + assertStrictEquals(actual, "Hello\nWorld"); } finally { process.close(); } diff --git a/std/examples/tests/catj_test.ts b/std/examples/tests/catj_test.ts index c3eb61f51..a859db0c1 100644 --- a/std/examples/tests/catj_test.ts +++ b/std/examples/tests/catj_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { assertStrictEq } from "../../testing/asserts.ts"; +import { assertStrictEquals } from "../../testing/asserts.ts"; Deno.test("[examples/catj] print an array", async () => { const decoder = new TextDecoder(); @@ -15,7 +15,7 @@ Deno.test("[examples/catj] print an array", async () => { '.[2].array[1] = "bar"', ].join("\n"); - assertStrictEq(actual, expected); + assertStrictEquals(actual, expected); } finally { process.stdin!.close(); process.close(); @@ -34,7 +34,7 @@ Deno.test("[examples/catj] print an object", async () => { '.array[0].message = "hello"', ].join("\n"); - assertStrictEq(actual, expected); + assertStrictEquals(actual, expected); } finally { process.stdin!.close(); process.close(); @@ -52,7 +52,7 @@ Deno.test("[examples/catj] print multiple files", async () => { const actual = decoder.decode(output).trim(); const expected = ['.message = "hello"', ".[0] = 1", ".[1] = 2"].join("\n"); - assertStrictEq(actual, expected); + assertStrictEquals(actual, expected); } finally { process.stdin!.close(); process.close(); @@ -69,7 +69,7 @@ Deno.test("[examples/catj] read from stdin", async () => { const output = await process.output(); const actual = decoder.decode(output).trim(); - assertStrictEq(actual, '.foo = "bar"'); + assertStrictEquals(actual, '.foo = "bar"'); } finally { process.close(); } diff --git a/std/examples/tests/colors_test.ts b/std/examples/tests/colors_test.ts index 90c469c00..1a3e4f418 100644 --- a/std/examples/tests/colors_test.ts +++ b/std/examples/tests/colors_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { assertStrictEq } from "../../testing/asserts.ts"; +import { assertStrictEquals } from "../../testing/asserts.ts"; Deno.test("[examples/colors] print a colored text", async () => { const decoder = new TextDecoder(); @@ -12,7 +12,7 @@ Deno.test("[examples/colors] print a colored text", async () => { const output = await process.output(); const actual = decoder.decode(output).trim(); const expected = "[44m[3m[31m[1mHello world![22m[39m[23m[49m"; - assertStrictEq(actual, expected); + assertStrictEquals(actual, expected); } finally { process.close(); } diff --git a/std/examples/tests/curl_test.ts b/std/examples/tests/curl_test.ts index 69e0e52d6..4449d11ea 100644 --- a/std/examples/tests/curl_test.ts +++ b/std/examples/tests/curl_test.ts @@ -1,6 +1,6 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. import { serve } from "../../http/server.ts"; -import { assertStrictEq } from "../../testing/asserts.ts"; +import { assertStrictEquals } from "../../testing/asserts.ts"; Deno.test({ name: "[examples/curl] send a request to a specified url", @@ -30,7 +30,7 @@ Deno.test({ const actual = decoder.decode(output).trim(); const expected = "Hello world"; - assertStrictEq(actual, expected); + assertStrictEquals(actual, expected); } finally { server.close(); process.close(); diff --git a/std/examples/tests/echo_server_test.ts b/std/examples/tests/echo_server_test.ts index 3e6096190..475b0f73f 100644 --- a/std/examples/tests/echo_server_test.ts +++ b/std/examples/tests/echo_server_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { assertStrictEq, assertNotEquals } from "../../testing/asserts.ts"; +import { assertStrictEquals, assertNotEquals } from "../../testing/asserts.ts"; import { BufReader, ReadLineResult } from "../../io/bufio.ts"; Deno.test("[examples/echo_server]", async () => { @@ -17,7 +17,7 @@ Deno.test("[examples/echo_server]", async () => { const message = await processReader.readLine(); assertNotEquals(message, null); - assertStrictEq( + assertStrictEquals( decoder.decode((message as ReadLineResult).line).trim(), "Listening on 0.0.0.0:8080" ); @@ -35,7 +35,7 @@ Deno.test("[examples/echo_server]", async () => { .trim(); const expectedResponse = "Hello echo_server"; - assertStrictEq(actualResponse, expectedResponse); + assertStrictEquals(actualResponse, expectedResponse); } finally { conn?.close(); process.stdout!.close(); diff --git a/std/examples/tests/welcome_test.ts b/std/examples/tests/welcome_test.ts index d508773c5..d585211a1 100644 --- a/std/examples/tests/welcome_test.ts +++ b/std/examples/tests/welcome_test.ts @@ -1,5 +1,5 @@ // Copyright 2018-2020 the Deno authors. All rights reserved. MIT license. -import { assertStrictEq } from "../../testing/asserts.ts"; +import { assertStrictEquals } from "../../testing/asserts.ts"; Deno.test("[examples/welcome] print a welcome message", async () => { const decoder = new TextDecoder(); @@ -12,7 +12,7 @@ Deno.test("[examples/welcome] print a welcome message", async () => { const output = await process.output(); const actual = decoder.decode(output).trim(); const expected = "Welcome to Deno 🦕"; - assertStrictEq(actual, expected); + assertStrictEquals(actual, expected); } finally { process.close(); } diff --git a/std/examples/tests/xeval_test.ts b/std/examples/tests/xeval_test.ts index eeeac7731..3db1459a9 100644 --- a/std/examples/tests/xeval_test.ts +++ b/std/examples/tests/xeval_test.ts @@ -4,7 +4,7 @@ import { stringsReader } from "../../io/util.ts"; import { decode, encode } from "../../encoding/utf8.ts"; import { assertEquals, - assertStrContains, + assertStringContains, assert, } from "../../testing/asserts.ts"; const { execPath, run } = Deno; @@ -52,6 +52,6 @@ Deno.test("xevalCliSyntaxError", async function (): Promise<void> { }); assertEquals(await p.status(), { code: 1, success: false }); assertEquals(decode(await p.output()), ""); - assertStrContains(decode(await p.stderrOutput()), "Uncaught SyntaxError"); + assertStringContains(decode(await p.stderrOutput()), "Uncaught SyntaxError"); p.close(); }); |