History

Use Effect test helpers for background work fixtures

Rhys Sullivan committed 1 month ago

Commit b84cc201 parent cf077b62 files · +2 −3Browse files

Unified · Split

2 files
  1. apps/cloud/src/auth/workos-callback-state.node.test.ts +1 −2
  2. apps/cloud/test-stubs/cloudflare-workers.ts +1 −1
apps/cloud/src/auth/workos-callback-state.node.test.ts+1−2
@@ -10,8 +10,7 @@ · 9 unmodified lines
10// HTTP surface (see api.request-scope.node.test.ts).10// HTTP surface (see api.request-scope.node.test.ts).
11// ---------------------------------------------------------------------------11// ---------------------------------------------------------------------------
12 12
13import { afterAll, describe, expect, it } from "@effect/vitest";13import { afterAll, describe, expect, it, vi } from "@effect/vitest";
14import { vi } from "vitest";
15import { waitUntil } from "cloudflare:workers";14import { waitUntil } from "cloudflare:workers";
16import { Effect, Layer } from "effect";15import { Effect, Layer } from "effect";
17import { HttpRouter, HttpServer } from "effect/unstable/http";16import { HttpRouter, HttpServer } from "effect/unstable/http";
apps/cloud/test-stubs/cloudflare-workers.ts+1−1
@@ -7,7 +7,7 @@ · 6 unmodified lines
7// from `process.env` into this stub at import time. Without this bridge7// from `process.env` into this stub at import time. Without this bridge
8// the test DbService would dial the default postgres port instead of the8// the test DbService would dial the default postgres port instead of the
9// PGlite socket server started by `scripts/test-globalsetup.ts`.9// PGlite socket server started by `scripts/test-globalsetup.ts`.
10import { vi } from "vitest";10import { vi } from "@effect/vitest";
11 11
12export const waitUntil = vi.fn<(work: Promise<unknown>) => void>();12export const waitUntil = vi.fn<(work: Promise<unknown>) => void>();
13 13