mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
test: migrate 207 test files to typed fixture registry (phase 5)
Codemod rewrites all five ad-hoc fixture-path styles to import from the typed registry (tests/fixtures/index.ts): - join(__dirname, "..", "fixtures", ...) inline patterns (100 files) - const FIXTURES = join(__dirname, ...) + join(FIXTURES, ...) (92 files) - process.cwd()-based paths (10 files) - path.resolve(__dirname, ...) patterns (5 files) Registry extended with 8 new keys (portraitJpg, portraitHeic, motorcycle, svgLogo, barcodeAvif, qrAvif, crossFormatChat, multipageTiff) and directory accessors (fixtureDir, fixtureRoot). Dynamic directory scanners (format-matrix-generated, format-matrix-multimodal, hostile-inputs) preserved via fixtureDir imports. No fixtures swapped, bytes identical. Parity gate: dropped 0, net-new 388.
This commit is contained in:
Vendored
+19
@@ -5,6 +5,17 @@ import { fileURLToPath } from "node:url";
|
||||
const ROOT = dirname(fileURLToPath(import.meta.url)); // tests/fixtures
|
||||
const p = (rel: string): string => join(ROOT, rel);
|
||||
|
||||
export const fixtureRoot = ROOT;
|
||||
export const fixtureDir = {
|
||||
formats: join(ROOT, "formats"),
|
||||
hostile: join(ROOT, "hostile"),
|
||||
media: join(ROOT, "media"),
|
||||
documents: join(ROOT, "documents"),
|
||||
data: join(ROOT, "data"),
|
||||
content: join(ROOT, "content"),
|
||||
security: join(ROOT, "security"),
|
||||
};
|
||||
|
||||
export const fixtures = {
|
||||
image: {
|
||||
base: {
|
||||
@@ -37,9 +48,16 @@ export const fixtures = {
|
||||
},
|
||||
code: {
|
||||
barcodePng: p("content/barcode.png"),
|
||||
barcodeAvif: p("content/barcode.avif"),
|
||||
qrPng: p("content/qr-code.png"),
|
||||
qrSvg: p("content/qr-code.svg"),
|
||||
qrAvif: p("content/qr-code.avif"),
|
||||
},
|
||||
svgLogo: p("content/svg-logo.svg"),
|
||||
motorcycle: p("content/motorcycle.heif"),
|
||||
crossFormatChat: p("content/cross-format-chat.webp"),
|
||||
portraitJpg: p("test-portrait.jpg"),
|
||||
portraitHeic: p("test-portrait.heic"),
|
||||
watermark: p("content/watermark.jpg"),
|
||||
stressLarge: p("content/stress-large.jpg"),
|
||||
edge: {
|
||||
@@ -49,6 +67,7 @@ export const fixtures = {
|
||||
extreme: p("test-portrait-extreme.png"),
|
||||
},
|
||||
formats: (ext: string) => p(`formats/sample.${ext}`),
|
||||
multipageTiff: p("formats/multipage.tiff"),
|
||||
hostile: {
|
||||
truncated: p("hostile/truncated.jpg"),
|
||||
garbage: p("hostile/garbage.jpg"),
|
||||
|
||||
Reference in New Issue
Block a user