Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(types): add explicit types to sync-env test helpers and dynamic import cast

diegosouzapwd08301de8ce4
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");
-
-function createTempRoot() {
+const { syncEnv } = (await import("../../scripts/sync-env.mjs")) as {
+ syncEnv: (opts?: { rootDir?: string; quiet?: boolean; scope?: string }) => {
+ created: boolean;
+ added: number;
+ };
+};
+
+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"),
[