fix: make SQLite migrations and e2e reproducible
This commit is contained in:
+15
-2
@@ -1,4 +1,17 @@
|
||||
process.env.DATABASE_URL ??= 'file:/tmp/wealth-ledger-e2e.db';
|
||||
const { join, dirname, basename } = require('node:path');
|
||||
const { tmpdir } = require('node:os');
|
||||
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=';
|
||||
process.env.TOKEN_ENCRYPTION_KEY =
|
||||
'MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWY=';
|
||||
|
||||
Reference in New Issue
Block a user