diff --git a/apps/api/test/ingredient-matcher.test.ts b/apps/api/test/recipe-matching/ingredient-matcher.test.ts similarity index 98% rename from apps/api/test/ingredient-matcher.test.ts rename to apps/api/test/recipe-matching/ingredient-matcher.test.ts index 6eb3e0a..913bce8 100644 --- a/apps/api/test/ingredient-matcher.test.ts +++ b/apps/api/test/recipe-matching/ingredient-matcher.test.ts @@ -1,6 +1,6 @@ import { INGREDIENT_LABEL_SYNONYMS_EN } from "@batch-cooking/shared"; import { expect } from "chai"; -import { prisma } from "../src/db/prisma.js"; +import { prisma } from "../../src/db/prisma.js"; import { extractQuantity, type IngredientMatchEntry, @@ -9,8 +9,8 @@ import { matchIngredientName, matchUnit, type UnitMatchEntry, -} from "../src/lib/recipe-matching/ingredient-matcher.js"; -import { resetDatabase } from "../test-support/reset-db.js"; +} from "../../src/lib/recipe-matching/ingredient-matcher.js"; +import { resetDatabase } from "../../test-support/reset-db.js"; describe("ingredient-matcher", () => { describe("matchIngredientName", () => { diff --git a/apps/api/test/recipe-translation.test.ts b/apps/api/test/recipe-matching/recipe-translation.test.ts similarity index 97% rename from apps/api/test/recipe-translation.test.ts rename to apps/api/test/recipe-matching/recipe-translation.test.ts index 6bf46ca..c74b98d 100644 --- a/apps/api/test/recipe-translation.test.ts +++ b/apps/api/test/recipe-matching/recipe-translation.test.ts @@ -1,9 +1,9 @@ import { expect } from "chai"; -import { prisma } from "../src/db/prisma.js"; +import { prisma } from "../../src/db/prisma.js"; import type { IngredientMatchEntry, UnitMatchEntry, -} from "../src/lib/recipe-matching/ingredient-matcher.js"; +} from "../../src/lib/recipe-matching/ingredient-matcher.js"; import { mergeDuplicateIngredients, type TranslatedRecipeIngredient, @@ -11,13 +11,13 @@ import { translateRecipeIngredients, translateRecipeSteps, type UnitConversionEntry, -} from "../src/lib/recipe-matching/recipe-translation.js"; -import type { TechStepMappingRule } from "../src/lib/recipe-matching/tech-step-matcher.js"; +} from "../../src/lib/recipe-matching/recipe-translation.js"; +import type { TechStepMappingRule } from "../../src/lib/recipe-matching/tech-step-matcher.js"; import type { ParsedRecipe, ParsedRecipeIngredient, -} from "../src/lib/recipe-sources/recipe-source-adapter.js"; -import { resetDatabase } from "../test-support/reset-db.js"; +} from "../../src/lib/recipe-sources/recipe-source-adapter.js"; +import { resetDatabase } from "../../test-support/reset-db.js"; /** A minimal fixture `ParsedRecipe` — only `steps` (built from `descriptions`) matters for most tests here, the rest is filler to prove it survives translation untouched. */ function buildParsedRecipe(descriptions: string[]): ParsedRecipe { diff --git a/apps/api/test/tech-step-matcher.test.ts b/apps/api/test/recipe-matching/tech-step-matcher.test.ts similarity index 98% rename from apps/api/test/tech-step-matcher.test.ts rename to apps/api/test/recipe-matching/tech-step-matcher.test.ts index e3faa9d..6f3a7b8 100644 --- a/apps/api/test/tech-step-matcher.test.ts +++ b/apps/api/test/recipe-matching/tech-step-matcher.test.ts @@ -1,13 +1,13 @@ import { expect } from "chai"; -import { prisma } from "../src/db/prisma.js"; +import { prisma } from "../../src/db/prisma.js"; import { loadTechStepMappingRules, matchTechStepSpans, matchTechSteps, normalizeText, type TechStepMappingRule, -} from "../src/lib/recipe-matching/tech-step-matcher.js"; -import { resetDatabase } from "../test-support/reset-db.js"; +} from "../../src/lib/recipe-matching/tech-step-matcher.js"; +import { resetDatabase } from "../../test-support/reset-db.js"; describe("tech-step-matcher", () => { describe("normalizeText", () => { diff --git a/apps/api/test/json-ld-recipe.test.ts b/apps/api/test/recipe-sources/json-ld-recipe.test.ts similarity index 98% rename from apps/api/test/json-ld-recipe.test.ts rename to apps/api/test/recipe-sources/json-ld-recipe.test.ts index a45e43f..ef32485 100644 --- a/apps/api/test/json-ld-recipe.test.ts +++ b/apps/api/test/recipe-sources/json-ld-recipe.test.ts @@ -2,8 +2,8 @@ import { expect } from "chai"; import { RecipeSourceFetchError, RecipeSourceParseError, -} from "../src/lib/recipe-sources/recipe-source-errors.js"; -import { jsonLdRecipeAdapter } from "../src/sources/json-ld-recipe.js"; +} from "../../src/lib/recipe-sources/recipe-source-errors.js"; +import { jsonLdRecipeAdapter } from "../../src/sources/json-ld-recipe.js"; /** Stubs `globalThis.fetch` to return `html` as the response body — same reasoning/pattern as `the-meal-db.test.ts`'s `stubFetch`, just returning text instead of JSON. */ function stubFetchHtml(html: string, status = 200) { diff --git a/apps/api/test/recipe-source-sync.test.ts b/apps/api/test/recipe-sources/recipe-source-sync.test.ts similarity index 94% rename from apps/api/test/recipe-source-sync.test.ts rename to apps/api/test/recipe-sources/recipe-source-sync.test.ts index 3153668..f5368be 100644 --- a/apps/api/test/recipe-source-sync.test.ts +++ b/apps/api/test/recipe-sources/recipe-source-sync.test.ts @@ -2,15 +2,15 @@ import type { SignupInput } from "@batch-cooking/shared"; import { faker } from "@faker-js/faker"; import { expect } from "chai"; import request from "supertest"; -import { createApp } from "../src/app.js"; -import { prisma } from "../src/db/prisma.js"; -import { findImportedRecipeIds, syncRecipeSources } from "../src/db/recipe-source-sync.js"; -import type { RecipeSourceAdapter } from "../src/lib/recipe-sources/recipe-source-adapter.js"; +import { createApp } from "../../src/app.js"; +import { prisma } from "../../src/db/prisma.js"; +import { findImportedRecipeIds, syncRecipeSources } from "../../src/db/recipe-source-sync.js"; +import type { RecipeSourceAdapter } from "../../src/lib/recipe-sources/recipe-source-adapter.js"; import { clearRecipeSources, registerRecipeSource, -} from "../src/lib/recipe-sources/recipe-source-registry.js"; -import { resetDatabase } from "../test-support/reset-db.js"; +} from "../../src/lib/recipe-sources/recipe-source-registry.js"; +import { resetDatabase } from "../../test-support/reset-db.js"; /** See `recipe.test.ts` — generated rather than hardcoded, no test fixture looks like a real person's data. */ function buildSignupPayload(): SignupInput { diff --git a/apps/api/test/recipe-source.test.ts b/apps/api/test/recipe-sources/recipe-source.test.ts similarity index 96% rename from apps/api/test/recipe-source.test.ts rename to apps/api/test/recipe-sources/recipe-source.test.ts index b8a2198..9085966 100644 --- a/apps/api/test/recipe-source.test.ts +++ b/apps/api/test/recipe-sources/recipe-source.test.ts @@ -5,19 +5,19 @@ import type { RecipeSourceListItem, RecipeSourceListParams, RecipeSourceListResult, -} from "../src/lib/recipe-sources/recipe-source-adapter.js"; -import { markAlreadyImported } from "../src/lib/recipe-sources/recipe-source-adapter.js"; +} from "../../src/lib/recipe-sources/recipe-source-adapter.js"; +import { markAlreadyImported } from "../../src/lib/recipe-sources/recipe-source-adapter.js"; import { RecipeSourceError, RecipeSourceFetchError, RecipeSourceParseError, -} from "../src/lib/recipe-sources/recipe-source-errors.js"; +} from "../../src/lib/recipe-sources/recipe-source-errors.js"; import { clearRecipeSources, getRecipeSource, listRecipeSources, registerRecipeSource, -} from "../src/lib/recipe-sources/recipe-source-registry.js"; +} from "../../src/lib/recipe-sources/recipe-source-registry.js"; interface FakeRawRecipe { externalId: string; diff --git a/apps/api/test/the-meal-db.test.ts b/apps/api/test/recipe-sources/the-meal-db.test.ts similarity index 97% rename from apps/api/test/the-meal-db.test.ts rename to apps/api/test/recipe-sources/the-meal-db.test.ts index 0517fe2..d79d694 100644 --- a/apps/api/test/the-meal-db.test.ts +++ b/apps/api/test/recipe-sources/the-meal-db.test.ts @@ -2,8 +2,8 @@ import { expect } from "chai"; import { RecipeSourceFetchError, RecipeSourceParseError, -} from "../src/lib/recipe-sources/recipe-source-errors.js"; -import { type TheMealDbMeal, theMealDbAdapter } from "../src/sources/the-meal-db.js"; +} from "../../src/lib/recipe-sources/recipe-source-errors.js"; +import { type TheMealDbMeal, theMealDbAdapter } from "../../src/sources/the-meal-db.js"; /** * Stubs `globalThis.fetch` for one test — no HTTP-mocking library exists diff --git a/apps/api/test/sources-index.test.ts b/apps/api/test/sources/sources-index.test.ts similarity index 89% rename from apps/api/test/sources-index.test.ts rename to apps/api/test/sources/sources-index.test.ts index 8ebbafd..caf8cb6 100644 --- a/apps/api/test/sources-index.test.ts +++ b/apps/api/test/sources/sources-index.test.ts @@ -3,8 +3,8 @@ import { clearRecipeSources, getRecipeSource, listRecipeSources, -} from "../src/lib/recipe-sources/recipe-source-registry.js"; -import { registerAllRecipeSources } from "../src/sources/index.js"; +} from "../../src/lib/recipe-sources/recipe-source-registry.js"; +import { registerAllRecipeSources } from "../../src/sources/index.js"; // Not exercised by any other test file — `registerAllRecipeSources` is // deliberately never imported by `app.ts` (see its own doc comment), so diff --git a/apps/api/test/sources.test.ts b/apps/api/test/sources/sources.test.ts similarity index 97% rename from apps/api/test/sources.test.ts rename to apps/api/test/sources/sources.test.ts index 16fd7b1..95428f0 100644 --- a/apps/api/test/sources.test.ts +++ b/apps/api/test/sources/sources.test.ts @@ -3,21 +3,21 @@ import { ErrorCode } from "@batch-cooking/shared"; import { faker } from "@faker-js/faker"; import { expect } from "chai"; import request from "supertest"; -import { createApp } from "../src/app.js"; -import { prisma } from "../src/db/prisma.js"; -import { syncRecipeSources } from "../src/db/recipe-source-sync.js"; +import { createApp } from "../../src/app.js"; +import { prisma } from "../../src/db/prisma.js"; +import { syncRecipeSources } from "../../src/db/recipe-source-sync.js"; import type { ParsedRecipe, RecipeSourceAdapter, RecipeSourceListParams, RecipeSourceListResult, -} from "../src/lib/recipe-sources/recipe-source-adapter.js"; -import { RecipeSourceFetchError } from "../src/lib/recipe-sources/recipe-source-errors.js"; +} from "../../src/lib/recipe-sources/recipe-source-adapter.js"; +import { RecipeSourceFetchError } from "../../src/lib/recipe-sources/recipe-source-errors.js"; import { clearRecipeSources, registerRecipeSource, -} from "../src/lib/recipe-sources/recipe-source-registry.js"; -import { resetDatabase } from "../test-support/reset-db.js"; +} from "../../src/lib/recipe-sources/recipe-source-registry.js"; +import { resetDatabase } from "../../test-support/reset-db.js"; /** See `recipe.test.ts` — generated rather than hardcoded, no test fixture looks like a real person's data. */ function buildSignupPayload(): SignupInput {