add more tests
This commit is contained in:
parent
b326d14676
commit
bfcb5ccaee
2 changed files with 24 additions and 2 deletions
|
@ -1,6 +1,6 @@
|
||||||
import { assertEquals } from "testing/asserts.ts";
|
import { assertEquals } from "testing/asserts.ts";
|
||||||
|
|
||||||
import { isNil, isSkip } from "./utils.ts";
|
import { concat, isNil, isSkip, join } from "./utils.ts";
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
name: "should check value on nil",
|
name: "should check value on nil",
|
||||||
|
@ -27,3 +27,25 @@ Deno.test({
|
||||||
assertEquals(isSkip([]), false);
|
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",
|
||||||
|
);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
|
@ -121,7 +121,7 @@ Deno.test({
|
||||||
});
|
});
|
||||||
|
|
||||||
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: () => {
|
fn: () => {
|
||||||
const layout = E("body", [], []);
|
const layout = E("body", [], []);
|
||||||
|
|
||||||
|
|
Reference in a new issue