diff --git a/src/hooks/auto-update-checker/checker/sync-package-json.test.ts b/src/hooks/auto-update-checker/checker/sync/sync-package-json.test.ts similarity index 97% rename from src/hooks/auto-update-checker/checker/sync-package-json.test.ts rename to src/hooks/auto-update-checker/checker/sync/sync-package-json.test.ts index 4f5bd42a5..eb0f8a0ff 100644 --- a/src/hooks/auto-update-checker/checker/sync-package-json.test.ts +++ b/src/hooks/auto-update-checker/checker/sync/sync-package-json.test.ts @@ -1,14 +1,14 @@ import { afterEach, beforeEach, describe, expect, it, mock } from "bun:test" import { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from "node:fs" import { join } from "node:path" -import type { PluginEntryInfo } from "./plugin-entry" +import type { PluginEntryInfo } from "../plugin-entry" const TEST_CACHE_DIR = join(import.meta.dir, "__test-sync-cache__") let importCounter = 0 -async function importFreshSyncPackageJsonModule(): Promise { - mock.module("../constants", () => ({ +async function importFreshSyncPackageJsonModule(): Promise { + mock.module("../../constants", () => ({ CACHE_DIR: TEST_CACHE_DIR, PACKAGE_NAME: "oh-my-opencode", NPM_REGISTRY_URL: "https://registry.npmjs.org/-/package/oh-my-opencode/dist-tags", @@ -21,11 +21,11 @@ async function importFreshSyncPackageJsonModule(): Promise null, })) - mock.module("../../../shared/logger", () => ({ + mock.module("../../../../shared/logger", () => ({ log: () => {}, })) - const syncPackageJsonModule = await import(`./sync-package-json?test=${importCounter++}`) + const syncPackageJsonModule = await import(`../sync-package-json?test=${importCounter++}`) mock.restore() return syncPackageJsonModule }