fix(FN-4812): stabilize hoisted update-cache test fixture
Fusion-Task-Id: FN-4812 Fusion-Task-Lineage: 9877a784-5320-410c-82fa-3f6a6d9b5358
This commit is contained in:
committed by
gsxdsm
parent
ec8d1f5246
commit
2a8e3e5f0c
@@ -6,11 +6,13 @@ const CLI_PACKAGE_VERSION = (
|
||||
JSON.parse(readFileSync(new URL("../../package.json", import.meta.url), "utf-8")) as { version: string }
|
||||
).version;
|
||||
|
||||
const cacheDir = `/tmp/fusion-update-cache-test-${process.pid}-${Date.now()}`;
|
||||
|
||||
const { mockResolveGlobalDir } = vi.hoisted(() => ({
|
||||
mockResolveGlobalDir: vi.fn().mockReturnValue(cacheDir),
|
||||
}));
|
||||
const { cacheDir, mockResolveGlobalDir } = vi.hoisted(() => {
|
||||
const dir = `/tmp/fusion-update-cache-test-${process.pid}-${Date.now()}`;
|
||||
return {
|
||||
cacheDir: dir,
|
||||
mockResolveGlobalDir: vi.fn().mockReturnValue(dir),
|
||||
};
|
||||
});
|
||||
|
||||
vi.mock("@fusion/core", () => ({
|
||||
resolveGlobalDir: mockResolveGlobalDir,
|
||||
|
||||
Reference in New Issue
Block a user