Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test(memories): type the Synology fakes' request init as RequestInit

Maurice70108e56940e
diff --git a/server/scripts/eslint-baseline.json b/server/scripts/eslint-baseline.json
index f02cd93d8..f81965340 100644
--- a/server/scripts/eslint-baseline.json
+++ b/server/scripts/eslint-baseline.json
@@ -16,7 +16,7 @@
"no-misleading-character-class": 1
},
"tests": {
- "@typescript-eslint/no-explicit-any": 1549,
+ "@typescript-eslint/no-explicit-any": 1545,
"@typescript-eslint/no-non-null-assertion": 1747,
"@typescript-eslint/no-require-imports": 25,
"@typescript-eslint/no-unsafe-function-type": 7,
diff --git a/server/tests/integration/memories-synology.test.ts b/server/tests/integration/memories-synology.test.ts
index 8ccf387c6..ab48b841e 100644
--- a/server/tests/integration/memories-synology.test.ts
+++ b/server/tests/integration/memories-synology.test.ts
@@ -418,7 +418,7 @@ describe('Synology listSynologyAlbums multi-source merge', () => {
const { user } = await makeUser(orm);
await setSynologyCredentials(orm, user.id, 'https://synology.example.com', 'admin', 'pass');
- vi.mocked(safeFetch).mockImplementation((_url: string, init?: any) => {
+ vi.mocked(safeFetch).mockImplementation((_url: string, init?: RequestInit) => {
// Always read both URL params and body params; body takes precedence for request-specific fields.
const urlParams = (() => {
try {
@@ -485,7 +485,7 @@ describe('Synology listSynologyAlbums multi-source merge', () => {
const { user } = await makeUser(orm);
await setSynologyCredentials(orm, user.id, 'https://synology.example.com', 'admin', 'pass');
- vi.mocked(safeFetch).mockImplementation((_url: string, init?: any) => {
+ vi.mocked(safeFetch).mockImplementation((_url: string, init?: RequestInit) => {
const urlParams = (() => {
try {
return new URL(String(_url)).searchParams;
@@ -572,7 +572,7 @@ describe('Synology listSynologyAlbums multi-source merge', () => {
const { user } = await makeUser(orm);
await setSynologyCredentials(orm, user.id, 'https://synology.example.com', 'admin', 'pass');
- vi.mocked(safeFetch).mockImplementation((_url: string, init?: any) => {
+ vi.mocked(safeFetch).mockImplementation((_url: string, init?: RequestInit) => {
const urlParams = (() => {
try {
return new URL(String(_url)).searchParams;
@@ -994,7 +994,7 @@ describe('Synology session retry on error codes 106/107/119', () => {
json: async () => body,
body: null,
} as any);
- vi.mocked(safeFetch).mockImplementation((_url: string, init?: any) => {
+ vi.mocked(safeFetch).mockImplementation((_url: string, init?: RequestInit) => {
const params: URLSearchParams =
init?.body instanceof URLSearchParams ? init.body : new URLSearchParams(String(init?.body ?? ''));
const api = params.get('api') || '';
@@ -1269,7 +1269,7 @@ describe('Synology SSRF blocked error handling', () => {
// reaches the fake first depends on how database reads interleave on each engine: the
// fake answers by API and category, not by call position.
const savedImpl = vi.mocked(safeFetch).getMockImplementation();
- vi.mocked(safeFetch).mockImplementation((_url: string, init?: any) => {
+ vi.mocked(safeFetch).mockImplementation((_url: string, init?: RequestInit) => {
const params: URLSearchParams =
init?.body instanceof URLSearchParams ? init.body : new URLSearchParams(String(init?.body ?? ''));
if (params.get('api') === 'SYNO.API.Auth') {