| @@ -159,8 +159,9 @@ describe.skipIf(!isWorkerdAvailable())("runtime-workerd-subprocess", () => { · 158 unmodified lines |
| 159 | 159 | await runner.ensureStarted(); |
| 160 | 160 | const pid = runner.pid(); |
| 161 | 161 | expect(pid).toEqual(expect.any(Number)); |
| 162 | + if (pid === undefined) throw new Error("workerd pid was unavailable"); |
| 162 | 163 | await runner.dispose(); |
| 163 | | − expect(await waitUntilGone(pid as number)).toBe(true); |
| 164 | + expect(await waitUntilGone(pid)).toBe(true); |
| 164 | 165 | }); |
| 165 | 166 | |
| 166 | 167 | it("restarts after a crash", async () => { |
| @@ -169,8 +170,9 @@ describe.skipIf(!isWorkerdAvailable())("runtime-workerd-subprocess", () => { · 2 unmodified lines |
| 169 | 170 | await runner.ensureStarted(); |
| 170 | 171 | const firstPid = runner.pid(); |
| 171 | 172 | expect(firstPid).toEqual(expect.any(Number)); |
| 173 | + if (firstPid === undefined) throw new Error("workerd pid was unavailable"); |
| 172 | 174 | runner.crashForTest(); |
| 173 | | − expect(await waitUntilGone(firstPid as number)).toBe(true); |
| 175 | + expect(await waitUntilGone(firstPid)).toBe(true); |
| 174 | 176 | const output = await runner.run<{ value: string }>({ op: "echo", value: "after" }); |
| 175 | 177 | expect(output.body.value).toBe("after"); |
| 176 | 178 | expect(runner.pid()).not.toBe(firstPid); |