Skip to content

Commit 73b61ec

Browse files
committed
feat(wrapper): add tests for isChild
1 parent 292a63d commit 73b61ec

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/unit/node/wrapper.test.ts

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { ChildProcess } from "child_process"
2+
import { ParentProcess, isChild } from "../../../src/node/wrapper"
3+
4+
describe("wrapper", () => {
5+
describe("isChild", () => {
6+
it("should return false for parent process", () => {
7+
const p = new ParentProcess("1")
8+
expect(isChild(p)).toBe(false)
9+
})
10+
})
11+
it("should return false for parent process", () => {
12+
const p = new ChildProcess()
13+
// our ChildProcess isn't exported
14+
// and shouldn't be for a test so surpressing TS error.
15+
// @ts-expect-error
16+
expect(isChild(p)).toBe(false)
17+
})
18+
})

0 commit comments

Comments
 (0)