mirror of
https://github.com/Nezumi-2711/9router.git
synced 2026-09-22 13:38:31 +00:00
fix: import the behavior of the web
This commit is contained in:
@@ -6,6 +6,10 @@ import os from "node:os";
|
||||
import path from "node:path";
|
||||
import { describe, it, expect, beforeAll, afterAll, vi } from "vitest";
|
||||
|
||||
vi.mock("@/lib/auth/currentUser", () => ({
|
||||
requireUsageDashboardUser: vi.fn(async () => ({ id: "test-admin", role: "admin" })),
|
||||
}));
|
||||
|
||||
const originalDataDir = process.env.DATA_DIR;
|
||||
let tempDir;
|
||||
let db;
|
||||
@@ -22,7 +26,7 @@ beforeAll(async () => {
|
||||
vi.resetModules();
|
||||
db = await import("@/lib/db/index.js");
|
||||
await db.initDb();
|
||||
await db.updateSettings({ enableObservability2: true, observabilityBatchSize: 1 });
|
||||
await db.updateSettings({ enableObservability: true, observabilityBatchSize: 1 });
|
||||
|
||||
const { getAdapter } = await import("@/lib/db/driver.js");
|
||||
adapter = await getAdapter();
|
||||
|
||||
Reference in New Issue
Block a user