From 7b8c82db4006f990a1ec220a3a1e0c260ffddaa9 Mon Sep 17 00:00:00 2001 From: lts372005 <87189679+lts372005@users.noreply.github.com> Date: Sat, 30 Oct 2021 07:55:20 +0700 Subject: [PATCH 1/2] unit test / utils / hasProperty --- tests/util/hasProperty.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 tests/util/hasProperty.ts diff --git a/tests/util/hasProperty.ts b/tests/util/hasProperty.ts new file mode 100644 index 000000000..7cf0bd412 --- /dev/null +++ b/tests/util/hasProperty.ts @@ -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); + }, +}); From 9979fd2ffbed6f6d53e91a1ea39a6cb7b6e78825 Mon Sep 17 00:00:00 2001 From: lts372005 <87189679+lts372005@users.noreply.github.com> Date: Sat, 30 Oct 2021 07:57:49 +0700 Subject: [PATCH 2/2] import unit test hasProperty --- tests/local.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/local.ts b/tests/local.ts index 78baeb048..738eda31b 100644 --- a/tests/local.ts +++ b/tests/local.ts @@ -1,2 +1,3 @@ import "./local/snowflake.ts"; import "./util/validateLength.ts"; +import "./util/hasProperty.ts";