MCPcopy Create free account
hub / github.com/anomalyco/models.dev / withFixture

Function withFixture

packages/core/test/generate.test.ts:9–16  ·  view source on GitHub ↗
(callback: (root: string) => Promise<T>)

Source from the content-addressed store, hash-verified

7import { generate, generateCatalog } from "../src/index.js";
8
9async function withFixture<T>(callback: (root: string) => Promise<T>) {
10 const root = await mkdtemp(path.join(tmpdir(), "models-dev-test-"));
11 try {
12 return await callback(root);
13 } finally {
14 await rm(root, { recursive: true, force: true });
15 }
16}
17
18async function write(root: string, file: string, content: string) {
19 const filePath = path.join(root, file);

Callers 1

generate.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected