23 lines · 808 B · TypeScript
RawDownload
import { expect, it } from "@effect/vitest";import * as Deferred from "effect/Deferred";import * as Effect from "effect/Effect"; import { forkParked, ServerActivation } from "./serverActivation.ts"; it.effect("proves a root is parked before returning and releases it with one gate", () =>  Effect.scoped(    Effect.gen(function* () {      const activation = yield* Deferred.make<void>();      const ran = yield* Deferred.make<void>();       yield* forkParked(Deferred.succeed(ran, undefined)).pipe(        Effect.provideService(ServerActivation, Deferred.await(activation)),      );      expect(yield* Deferred.isDone(ran)).toBe(false);       yield* Deferred.succeed(activation, undefined);      yield* Deferred.await(ran);      expect(yield* Deferred.isDone(ran)).toBe(true);    }),  ),);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t