mirror of
https://github.com/BradGroux/veritas-kanban.git
synced 2026-11-19 09:01:21 +00:00
Run browser fixtures with owned temporary storage, synthetic credentials, authoritative endpoints, and isolated API startup. Local safety and real disposable API CRUD checks passed. Fixes #1610.
15 lines
743 B
JavaScript
15 lines
743 B
JavaScript
#!/usr/bin/env node
|
|
import { createRequire } from 'node:module';
|
|
import path from 'node:path';
|
|
import { pathToFileURL } from 'node:url';
|
|
import { readBrowserEnvironment } from './browser-test-environment.mjs';
|
|
|
|
const repoRoot = path.resolve(import.meta.dirname, '..');
|
|
const { serverCwd } = readBrowserEnvironment(repoRoot);
|
|
const require = createRequire(path.join(repoRoot, 'server/package.json'));
|
|
const { register } = await import(pathToFileURL(require.resolve('tsx/esm/api')).href);
|
|
|
|
// Change cwd before importing any server module, including dotenv and migration.
|
|
process.chdir(serverCwd);
|
|
register({ tsconfig: path.join(repoRoot, 'server/tsconfig.json') });
|
|
await import(pathToFileURL(path.join(repoRoot, 'server/src/index.ts')).href);
|