Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

test: import vi in the trip members suite and type the move's SQLite ORM options

Maurice223a7605edb7
diff --git a/server/tests/postgres/sqlite-move.test.ts b/server/tests/postgres/sqlite-move.test.ts
index f0dee47ae..2b6c05cac 100644
--- a/server/tests/postgres/sqlite-move.test.ts
+++ b/server/tests/postgres/sqlite-move.test.ts
@@ -44,7 +44,7 @@ import { setAppSetting, setUserSetting } from '../helpers/factories/settings';
import { makeTrip, readTripDays } from '../helpers/factories/trips';
import { makeUser } from '../helpers/factories/users';
import { databaseUrl, withAdmin } from './databases';
-import { MikroORM, type EntityClass } from '@mikro-orm/core';
+import { MikroORM, type EntityClass, type Options } from '@mikro-orm/core';
import type { AbstractSqlConnection } from '@mikro-orm/sql';
import type { INestApplication } from '@nestjs/common';
@@ -69,12 +69,15 @@ async function migratedSqlite(file: string): Promise<AnyOrm> {
handle = new Database(file);
handle.pragma('foreign_keys = ON');
const config = buildOrmConfig(new SqliteEngine());
- const orm = await MikroORM.init({
+ // Typed as the engine's plain Options: the bound driver alone would make
+ // init infer the SQLite driver's own entity manager, which config does not name.
+ const options: Options = {
...config,
driver: createBoundSqliteDriver(() => handle),
dbName: file,
migrations: { ...config.migrations, silent: true },
- });
+ };
+ const orm = await MikroORM.init(options);
await runSchemaBootstrap(orm, { snapshot: false });
return orm;
}
diff --git a/server/tests/unit/mcp/tools-trip-members.test.ts b/server/tests/unit/mcp/tools-trip-members.test.ts
index b5b13470f..14bc2b18c 100644
--- a/server/tests/unit/mcp/tools-trip-members.test.ts
+++ b/server/tests/unit/mcp/tools-trip-members.test.ts
@@ -25,7 +25,7 @@ import { resetDatabase } from '../../helpers/reset-database';
import { bootTestApp } from '../../helpers/test-app';
import { MikroORM } from '@mikro-orm/core';
-import { describe, it, expect, beforeAll, beforeEach, afterAll } from 'vitest';
+import { describe, it, expect, beforeAll, beforeEach, afterAll, vi } from 'vitest';
const realtime = new FakeRealtimeService();
const broadcastMock = realtime.broadcastMock;