Skip to content

Commit 73faddd

Browse files
committed
fixup: use our childProcess
1 parent 4a5ef4c commit 73faddd

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

src/node/wrapper.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ abstract class Process {
147147
* Child process that will clean up after itself if the parent goes away and can
148148
* perform a handshake with the parent and ask it to relaunch.
149149
*/
150-
class ChildProcess extends Process {
150+
export class ChildProcess extends Process {
151151
public logger = logger.named(`child:${process.pid}`)
152152

153153
public constructor(private readonly parentPid: number) {

test/unit/node/wrapper.test.ts

+3-7
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import { ChildProcess } from "child_process"
2-
import { ParentProcess, isChild } from "../../../src/node/wrapper"
1+
import { ChildProcess, ParentProcess, isChild } from "../../../src/node/wrapper"
32

43
describe("wrapper", () => {
54
describe("isChild", () => {
@@ -9,10 +8,7 @@ describe("wrapper", () => {
98
})
109
})
1110
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 - see above
16-
expect(isChild(p)).toBe(false)
11+
const childProc = new ChildProcess(1)
12+
expect(isChild(childProc)).toBe(true)
1713
})
1814
})

0 commit comments

Comments
 (0)