Skip to content

Commit 70cafeb

Browse files
committed
test(server): flatten timeout discovery pipeline
1 parent 5fa477d commit 70cafeb

1 file changed

Lines changed: 16 additions & 7 deletions

File tree

‎apps/server/src/environment/staleWhileRevalidate.test.ts‎

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,10 @@ it.effect("starts over after a failed first scan", () =>
8888
const calls = yield* Ref.make(0);
8989
const read = yield* makeStaleWhileRevalidate(
9090
Ref.updateAndGet(calls, (count) => count + 1).pipe(
91-
Effect.filterOrElse((call) => call !== 1, () => Effect.die("probe crashed")),
91+
Effect.filterOrElse(
92+
(call) => call !== 1,
93+
() => Effect.die("probe crashed"),
94+
),
9295
),
9396
"60 seconds",
9497
);
@@ -108,13 +111,18 @@ it.effect("abandons a hung refresh so a later call can start another", () =>
108111
Ref.updateAndGet(calls, (count) => count + 1).pipe(
109112
Effect.flatMap((call) =>
110113
call === 2
111-
? Effect.fiber.pipe(Effect.flatMap((fiber) => Deferred.succeed(started, fiber))).pipe(
114+
? Effect.fiber.pipe(
115+
Effect.flatMap((fiber) => Deferred.succeed(started, fiber)),
112116
Effect.andThen(Effect.never),
113117
Effect.onInterrupt(() => Deferred.succeed(interrupted, undefined)),
114118
)
115119
: Effect.succeed(call).pipe(
116120
Effect.tap(() =>
117-
call === 3 ? Effect.fiber.pipe(Effect.flatMap((fiber) => Deferred.succeed(refreshed, fiber))) : Effect.void,
121+
call === 3
122+
? Effect.fiber.pipe(
123+
Effect.flatMap((fiber) => Deferred.succeed(refreshed, fiber)),
124+
)
125+
: Effect.void,
118126
),
119127
),
120128
),
@@ -149,10 +157,11 @@ it.effect("interrupts a background refresh when the owning scope closes", () =>
149157
Ref.updateAndGet(calls, (count) => count + 1).pipe(
150158
Effect.filterOrElse(
151159
(call) => call === 1,
152-
() => Deferred.succeed(started, undefined).pipe(
153-
Effect.andThen(Effect.never),
154-
Effect.onInterrupt(() => Deferred.succeed(interrupted, undefined)),
155-
),
160+
() =>
161+
Deferred.succeed(started, undefined).pipe(
162+
Effect.andThen(Effect.never),
163+
Effect.onInterrupt(() => Deferred.succeed(interrupted, undefined)),
164+
),
156165
),
157166
),
158167
"60 seconds",

0 commit comments

Comments
 (0)