Archived
1
0
Fork 0
This repository has been archived on 2024-07-25. You can view files and clone it, but cannot push or open issues or pull requests.
paren/core/utils.test.ts

30 lines
771 B
TypeScript
Raw Normal View History

2022-05-22 00:03:48 +03:00
import { assertEquals } from "testing/asserts.ts";
import { isNil, isSkip } from "./utils.ts";
Deno.test({
name: "should check value on nil",
fn: () => {
assertEquals(isNil(null), true);
assertEquals(isNil(undefined), true);
assertEquals(isNil(0), false);
assertEquals(isNil(""), false);
assertEquals(isNil(false), false);
assertEquals(isNil({}), false);
assertEquals(isNil([]), false);
},
});
Deno.test({
name: "should check value on skip",
fn: () => {
assertEquals(isSkip(null), true);
assertEquals(isSkip(undefined), true);
assertEquals(isSkip(0), false);
assertEquals(isSkip(""), false);
assertEquals(isSkip(false), true);
assertEquals(isSkip({}), false);
assertEquals(isSkip([]), false);
},
});