From 73b61ecfb67732d17bdd5152fea1ecdf9f723cfd Mon Sep 17 00:00:00 2001 From: Joe Previte Date: Mon, 5 Dec 2022 16:11:45 -0700 Subject: [PATCH] feat(wrapper): add tests for isChild --- test/unit/node/wrapper.test.ts | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/unit/node/wrapper.test.ts diff --git a/test/unit/node/wrapper.test.ts b/test/unit/node/wrapper.test.ts new file mode 100644 index 000000000..7c8a6bf05 --- /dev/null +++ b/test/unit/node/wrapper.test.ts @@ -0,0 +1,18 @@ +import { ChildProcess } from "child_process" +import { ParentProcess, isChild } from "../../../src/node/wrapper" + +describe("wrapper", () => { + describe("isChild", () => { + it("should return false for parent process", () => { + const p = new ParentProcess("1") + expect(isChild(p)).toBe(false) + }) + }) + it("should return false for parent process", () => { + const p = new ChildProcess() + // our ChildProcess isn't exported + // and shouldn't be for a test so surpressing TS error. + // @ts-expect-error + expect(isChild(p)).toBe(false) + }) +})