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", [], []);