Download packages/core/test/legacy-event-schema.test.ts from SaylorTwift/opencode: direct link, hf CLI and curl.
- Browser
- Download file 736 Bytes
-
https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/test/legacy-event-schema.test.ts
- Command line
-
hf download hf://SaylorTwift/opencode/packages/core/test/legacy-event-schema.test.ts
-
curl -L -o legacy-event-schema.test.ts https://huggingface.co/SaylorTwift/opencode/resolve/main/packages/core/test/legacy-event-schema.test.ts
736 Bytes
| import { describe, expect, test } from "bun:test" | |
| import { SessionV1 as Wire } from "@opencode-ai/schema/session-v1" | |
| import { SessionV1 } from "../src/v1/session" | |
| describe("legacy event schema compatibility", () => { | |
| test("Core references canonical SessionV1 definitions", () => { | |
| expect(SessionV1.Event.Created).toBe(Wire.Event.Created) | |
| expect(SessionV1.Event.PartUpdated).toBe(Wire.Event.PartUpdated) | |
| }) | |
| test("Core retains NamedError constructor identity", () => { | |
| const error = new SessionV1.APIError({ message: "failed", isRetryable: false }) | |
| expect(error).toBeInstanceOf(SessionV1.APIError) | |
| expect(error.toObject()).toEqual({ name: "APIError", data: { message: "failed", isRetryable: false } }) | |
| }) | |
| }) | |