Files
boc/projects/landvex/api/tests/setup.js
T
Bernt 6de2455917 v1.2.0: Add Global Markets footer, translated to 9 languages
- Added GLOBAL_MARKETS_TITLE to all translation files
- Updated footer with 12 markets (4 active + 8 upcoming)
- Translated market section to: zh-cn, zh-tw, ja, ko, th, vi, id, ms, hi
- Built and deployed to production
- CloudFront invalidation: I3RTMXVFDJXWLG3SYX208OP1CC
2026-07-08 19:56:03 +00:00

36 lines
794 B
JavaScript

/**
* Test-setup för LandveX API Fas 2
*/
const db = require('../src/config/database');
const Bounty = require('../src/models/bounty');
const Identify = require('../src/models/identify');
// Återställ databasen före varje test
beforeEach(() => {
// Rensa testtabeller
const tables = [
'bounties', 'bounty_submissions', 'individregister',
'submission_dubletter', 'zoomer_profiler', 'notifikationer',
'feedback_ko', 'identify_forsok', 'golden_cases', 'konfidenskalibrering'
];
for (const table of tables) {
try {
db.prepare(`DELETE FROM ${table}`).run();
} catch (e) {
// Tabellen kanske inte finns än
}
}
});
// Initiera tabeller
beforeAll(() => {
Bounty.initTables();
Identify.initTables();
});
afterAll(() => {
db.close();
});