chore(tracker-web): type proxy test request

Replace the tracker proxy test helper's any cast with an explicit NextRequest test double bridge.

Verification: pnpm --filter @bytelyst/tracker-web typecheck; pnpm --filter @bytelyst/tracker-web test; pnpm --filter @bytelyst/tracker-web exec eslint . --ext .ts,.tsx; pnpm lint.
This commit is contained in:
Saravana Achu Mac 2026-05-04 15:20:50 -07:00
parent afe7d88869
commit b6da94dd4a

View File

@ -3,6 +3,7 @@
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import type { NextRequest } from 'next/server';
// Mock global fetch
const mockFetch = vi.fn();
@ -15,7 +16,7 @@ function mockNextRequest(
path: string,
body?: string,
headers?: Record<string, string>
) {
): NextRequest {
const _url = new URL(`http://localhost:3003/api/tracker/${path}`);
const headerMap = new Map(Object.entries(headers || {}));
return {
@ -27,7 +28,7 @@ function mockNextRequest(
searchParams: new URLSearchParams(),
},
text: async () => body || '',
} as any;
} as unknown as NextRequest;
}
describe('tracker proxy', () => {