add more tests

This commit is contained in:
Dmitriy Pleshevskiy 2022-05-22 00:13:39 +03:00
parent b326d14676
commit bfcb5ccaee
2 changed files with 24 additions and 2 deletions

View File

@ -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",
);
},
});

View File

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