Open History to see the last commit
1import { assert, it } from "@effect/vitest";
2import * as Effect from "effect/Effect";
3import * as Schema from "effect/Schema";
4
5import { ThreadPullRequestLink } from "./threadPullRequest.ts";
6
7const decodeLinks = Schema.decodeUnknownEffect(Schema.Array(ThreadPullRequestLink));
8
9it.effect("decodes a watch saved before passed checks were recorded", () =>
10 Effect.gen(function* () {
11 const [link] = yield* decodeLinks([
12 {
13 host: "github.com",
14 repository: "pingdotgg/t3code",
15 number: 42,
16 url: "https://github.com/pingdotgg/t3code/pull/42",
17 source: "agent",
18 linkedAt: "2026-01-01T00:00:00.000Z",
19 snapshot: null,
20 stack: null,
21 watch: {
22 startedAt: "2026-01-01T00:00:00.000Z",
23 headSha: "abc123",
24 failedChecks: [],
25 passed: true,
26 remarksThrough: "2026-01-01T00:00:00.000Z",
27 remarkIds: [],
28 conflicting: false,
29 wakes: 0,
30 },
31 },
32 ]);
33
34 assert.deepStrictEqual(link?.watch?.passedChecks, []);
35 }),
36);