fix(next16): move v1 images API test out of src/pages

Next 16's route-type validator treats every file under src/pages as a route
and requires a `default` export, so the test added in #2423 at
src/pages/api/v1/images/__tests__/index.test.ts failed typecheck/build
("does not satisfy ApiRouteConfig"). Moved it to src/tests/api/v1/images/
(still matched by vitest's `src/**/*.test.ts`) and switched the handler import
to the `~/` alias. vi.mock calls already used `~/`, so behavior is unchanged.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Briant Diehl
2026-06-08 11:49:08 -06:00
parent 6aa4d37392
commit 4c4d100df6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/dev/types/routes.d.ts";
import "./.next/types/routes.d.ts";
// NOTE: This file should not be edited
// see https://nextjs.org/docs/pages/api-reference/config/typescript for more information.
@@ -71,7 +71,7 @@ vi.mock('~/server/utils/endpoint-helpers', () => ({
}));
// 2. Import the handler after the mocks are defined
import handler from '../index';
import handler from '~/pages/api/v1/images/index';
// 3. Helper to mock NextApiRequest/Response
function createMocks({ query = {} }: { query?: Record<string, string | string[]> }) {