mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-11-04 00:00:28 +09:00
21 lines
649 B
TypeScript
21 lines
649 B
TypeScript
import { mkdtemp } from "fs/promises";
|
|
import { tmpdir } from "os";
|
|
import { join } from "path";
|
|
import { vi } from "vitest";
|
|
|
|
const storagePath = await mkdtemp(join(tmpdir(), "arkvault-test-"));
|
|
|
|
vi.mock("#lib/server/config.ts", async () => {
|
|
const { inject } = await import("vitest");
|
|
return {
|
|
default: {
|
|
nodeEnv: "test",
|
|
database: inject("database"),
|
|
session: { secret: "test-secret", exp: 14 * 24 * 3600 * 1000 },
|
|
challenge: { userClientExp: 5 * 60 * 1000, sessionUpgradeExp: 5 * 60 * 1000 },
|
|
libraryPath: join(storagePath, "library"),
|
|
thumbnailsPath: join(storagePath, "thumbnails"),
|
|
},
|
|
};
|
|
});
|