Archived
1
0

feat(wrapper): add tests for isChild

This commit is contained in:
Joe Previte 2022-12-05 16:11:45 -07:00
parent 292a63dccd
commit 73b61ecfb6
No known key found for this signature in database
GPG Key ID: 2C91590C6B742C24

View File

@ -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)
})
})