const { tmpdir } = require('node:os'); const { join, dirname, basename } = require('node:path'); const dir = process.env.WL_E2E_DIRECTORY; if ( !dir || dirname(dir) !== tmpdir() || !basename(dir).startsWith('wealthledger-e2e-') || process.env.DATABASE_URL !== `file:${join(dir, 'test.db')}` ) { throw new Error( 'Use npm run test:e2e or test:sqlite: an isolated runner database is required.', ); } process.env.FRONTEND_ORIGIN = 'http://localhost:5173'; process.env.JWT_SECRET = 'e2e-secret-that-is-at-least-thirty-two-characters'; process.env.TOKEN_ENCRYPTION_KEY = 'MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=';