|
3 | 3 | import { config } from "dotenv"; |
4 | 4 | import path from "node:path"; |
5 | 5 | import { vi } from "vitest"; |
| 6 | +import type * as IORedisModule from "ioredis"; |
| 7 | +import type * as TaskMetadataCacheModule from "~/services/taskMetadataCache.server"; |
6 | 8 |
|
7 | 9 | config({ path: path.resolve(__dirname, "../.env") }); |
8 | 10 |
|
@@ -56,7 +58,7 @@ const noopProxy = () => |
56 | 58 | // command (tests against live testcontainers) connects on first command |
57 | 59 | // exactly as before. |
58 | 60 | vi.mock("ioredis", async (importOriginal) => { |
59 | | - const actual = await importOriginal<typeof import("ioredis")>(); |
| 61 | + const actual = await importOriginal<typeof IORedisModule>(); |
60 | 62 |
|
61 | 63 | // Normalize ioredis's overloaded ctor args — (), (port), (path), |
62 | 64 | // (port, host), (opts), (port, opts), (port, host, opts), (path, opts) — |
@@ -127,9 +129,9 @@ vi.mock("~/v3/services/tracePubSub.server", async () => { |
127 | 129 | // leaves TASK_META_CACHE_REDIS_HOST unset and gets the Noop implementation; |
128 | 130 | // pin the Noop cache here so env-configured local runs behave identically. |
129 | 131 | vi.mock("~/services/taskMetadataCacheInstance.server", async () => { |
130 | | - const { NoopTaskMetadataCache } = await vi.importActual< |
131 | | - typeof import("~/services/taskMetadataCache.server") |
132 | | - >("~/services/taskMetadataCache.server"); |
| 132 | + const { NoopTaskMetadataCache } = await vi.importActual<typeof TaskMetadataCacheModule>( |
| 133 | + "~/services/taskMetadataCache.server" |
| 134 | + ); |
133 | 135 | return { taskMetadataCacheInstance: new NoopTaskMetadataCache() }; |
134 | 136 | }); |
135 | 137 |
|
|
0 commit comments