test(core): fix more tests

This commit is contained in:
Elian Doran
2026-04-09 17:41:47 +03:00
parent 3a7ce0c284
commit f40de0a017
10 changed files with 61 additions and 14 deletions

View File

@@ -20,12 +20,13 @@ process.env.TRILIUM_PUBLIC_SERVER = "http://localhost:4200";
beforeAll(async () => {
// Load the integration test database into memory. The fixture at
// spec/db/document.db is pre-seeded with the schema, demo content, and
// a known password ("demo1234") that the ETAPI tests log in with. Each
// test file runs in its own vitest fork (pool: "forks"), so each gets a
// fresh in-memory copy and mutations don't leak across files.
// packages/trilium-core/src/test/fixtures/document.db is pre-seeded with
// the schema, demo content, and a known password ("demo1234") that the
// ETAPI tests log in with. Each test file runs in its own vitest fork
// (pool: "forks"), so each gets a fresh in-memory copy and mutations
// don't leak across files.
const dbProvider = new BetterSqlite3Provider();
dbProvider.loadFromBuffer(readFileSync(join(__dirname, "db", "document.db")));
dbProvider.loadFromBuffer(readFileSync(require.resolve("@triliumnext/core/src/test/fixtures/document.db")));
await initializeCore({
dbConfig: {