From bfcb5ccaee7f562d13ac28d04b9dec7d25d44bdf Mon Sep 17 00:00:00 2001 From: Dmitriy Pleshevskiy Date: Sun, 22 May 2022 00:13:39 +0300 Subject: [PATCH] add more tests --- core/utils.test.ts | 24 +++++++++++++++++++++++- ren/str.test.ts | 2 +- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/core/utils.test.ts b/core/utils.test.ts index 6a1dde6..1969613 100644 --- a/core/utils.test.ts +++ b/core/utils.test.ts @@ -1,6 +1,6 @@ import { assertEquals } from "testing/asserts.ts"; -import { isNil, isSkip } from "./utils.ts"; +import { concat, isNil, isSkip, join } from "./utils.ts"; Deno.test({ name: "should check value on nil", @@ -27,3 +27,25 @@ Deno.test({ assertEquals(isSkip([]), false); }, }); + +Deno.test({ + name: "should return joined array", + fn: () => { + assertEquals(join(" ", ["hello", "world"]), "hello world"); + assertEquals( + join(" ", ["hello", "", null, undefined, false, "world"]), + "hello world", + ); + }, +}); + +Deno.test({ + name: "should return concated array", + fn: () => { + assertEquals(concat(["hello", "world"]), "helloworld"); + assertEquals( + concat(["hello", "", null, undefined, false, "world"]), + "helloworld", + ); + }, +}); diff --git a/ren/str.test.ts b/ren/str.test.ts index f26dae7..d44e9c9 100644 --- a/ren/str.test.ts +++ b/ren/str.test.ts @@ -121,7 +121,7 @@ Deno.test({ }); Deno.test({ - name: "should force render doctype if root nod is not html", + name: "should force render doctype if root node is not html", fn: () => { const layout = E("body", [], []);