trips) adding package-tours option

This commit is contained in:
2026-02-19 13:08:25 -05:00
parent 50e216daec
commit dba9aa0416
51 changed files with 5581 additions and 57 deletions

16
src/tests/helpers.ts Normal file
View File

@@ -0,0 +1,16 @@
import { createSqliteDb } from '$lib/server/db/sqlite.js';
import { runMigrations } from '$lib/server/db/migrations.js';
import { _setDb } from '$lib/server/db/index.js';
import type { Database } from '$lib/server/db/types.js';
/**
* Creates a fresh in-memory SQLite database, runs all migrations, and injects
* it into the server module singleton. Call in beforeEach; call db.close() in
* afterEach to release the in-memory DB.
*/
export function setupTestDb(): Database {
const database = createSqliteDb(':memory:');
runMigrations(database);
_setDb(database);
return database;
}

3
src/tests/stubs/env.ts Normal file
View File

@@ -0,0 +1,3 @@
// Stub for $env/dynamic/private — not available outside SvelteKit at test time.
// Tests bypass createDb() entirely via _setDb(), so this is never actually read.
export const env: Record<string, string> = {};

3
src/tests/stubs/paths.ts Normal file
View File

@@ -0,0 +1,3 @@
// Stub for $app/paths — used by some server helpers for URL construction.
export const base = '';
export const assets = '';