unit test / utils / hasProperty

This commit is contained in:
lts372005
2021-10-30 07:55:20 +07:00
parent d3597fa561
commit 7b8c82db40
+15
View File
@@ -0,0 +1,15 @@
import { hasProperty } from "../../src/util/utils.ts";
import { assertEquals } from "../deps.ts";
const obj = { prop: "lts372005" };
Deno.test({
name: "[utils] hasProperty does HAVE property",
fn() {
assertEquals(hasProperty(obj, "prop"), true);
},
});
Deno.test({
name: "[utils] hasProperty does NOT HAVE property",
fn() {
assertEquals(hasProperty(obj, "lts372005"), false);
},
});