Open History to see the last commit
1import { it } from "@effect/vitest";
2import * as Effect from "effect/Effect";
3import { expect } from "vite-plus/test";
4
5import { awaitDetachedSpawn } from "./windowsVerbatimSpawn.ts";
6
7it.effect("reports a synchronous spawn exception as a failure", () =>
8 Effect.gen(function* () {
9 const error = new Error("invalid spawn options");
10 const result = yield* awaitDetachedSpawn(() => {
11 throw error;
12 }).pipe(Effect.result);
13 expect(result).toMatchObject({ _tag: "Failure", failure: error });
14 }),
15);