feat(wrapper): add tests for isChild
This commit is contained in:
parent
292a63dccd
commit
73b61ecfb6
18
test/unit/node/wrapper.test.ts
Normal file
18
test/unit/node/wrapper.test.ts
Normal 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)
|
||||||
|
})
|
||||||
|
})
|
Reference in New Issue
Block a user