Model Client.Test
Path:
loom-sprint-scaffold/loom/tests/execution/model-client.test.tsRelative: loom/tests/execution/model-client.test.tsSubproject: loom-sprint-scaffoldCategory: testsLines: 349Bytes: 10,934Imports: 3Exports: 0has tests
Content Preview
- /**
- * Tests for model-client (H3.0).
- *
- * Proves:
- * - createAnthropicModelCaller returns a callable ModelCaller
- * - wraps calls with retry (≥3 attempts on 5xx)
- * - fails fast on 4xx errors (ModelError.status)
- * - passes correct JSON body to fetch
- * - the returned function matches the ModelCaller interface
- *
- * CRITICAL: Tests inject a fake fetchFn — never hit the real Anthropic API.
- */
- import { describe, expect, test } from "bun:test";
- import { createAnthropicModelCaller } from "../../s