* refactor(draw-image): add tests/fixtures/cover.svg and loadFixture helper * feat(draw-image): add --template-dir flag to cli for test isolation * refactor(draw-image): switch tests from templates/cover to fixtures * chore(draw-image): simplify production cover.svg now decoupled from tests * docs(handoff): add handoff + ADR for issue #196 * docs(handoff): set PR number * docs(project-map): update after structural changes --------- Co-authored-by: opencode-agent <agent@opencode.local>
13 lines
No EOL
441 B
TypeScript
13 lines
No EOL
441 B
TypeScript
import { readFileSync } from "node:fs"
|
|
import path from "node:path"
|
|
import { fileURLToPath } from "node:url"
|
|
|
|
const __dirname = path.dirname(fileURLToPath(import.meta.url))
|
|
const FIXTURES_DIR = path.resolve(__dirname, "..", "fixtures")
|
|
|
|
export const FIXTURES_DIR_ABS = FIXTURES_DIR
|
|
|
|
export function loadFixture(name: string): string {
|
|
const fixturePath = path.join(FIXTURES_DIR, `${name}.svg`)
|
|
return readFileSync(fixturePath, "utf-8")
|
|
} |