From d08301de8ce40cd81559f6f4c34a8dbb6dca4b64 Mon Sep 17 00:00:00 2001 From: diegosouzapw Date: Sun, 26 Apr 2026 14:09:44 -0300 Subject: [PATCH] fix(types): add explicit types to sync-env test helpers and dynamic import cast Resolves 7 TypeScript errors: implicit 'any' on rootDir parameters and unknown property 'rootDir' on the dynamically imported syncEnv options. --- tests/unit/sync-env.test.ts | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tests/unit/sync-env.test.ts b/tests/unit/sync-env.test.ts index f8569c056a..c20cdc85c2 100644 --- a/tests/unit/sync-env.test.ts +++ b/tests/unit/sync-env.test.ts @@ -4,13 +4,18 @@ import fs from "node:fs"; import os from "node:os"; import path from "node:path"; -const { syncEnv } = await import("../../scripts/sync-env.mjs"); +const { syncEnv } = (await import("../../scripts/sync-env.mjs")) as { + syncEnv: (opts?: { rootDir?: string; quiet?: boolean; scope?: string }) => { + created: boolean; + added: number; + }; +}; -function createTempRoot() { +function createTempRoot(): string { return fs.mkdtempSync(path.join(os.tmpdir(), "omniroute-sync-env-")); } -function writeEnvExample(rootDir) { +function writeEnvExample(rootDir: string) { fs.writeFileSync( path.join(rootDir, ".env.example"), [ @@ -27,7 +32,7 @@ function writeEnvExample(rootDir) { ); } -function writeOauthEnvExample(rootDir) { +function writeOauthEnvExample(rootDir: string) { fs.writeFileSync( path.join(rootDir, ".env.example"), [