refactor(esm): migrate server and tests from CommonJS to ESM

Convert all server/, test, and setup files from require()/module.exports
to import/export syntax. Activate ESM globally via "type": "module" in
package.json and load dotenv via --import dotenv/config in npm scripts.
This commit is contained in:
Ulas
2026-04-03 23:11:20 +02:00
parent 2f6127911e
commit b139eea623
24 changed files with 113 additions and 154 deletions
+2 -4
View File
@@ -7,15 +7,13 @@
* Ausführen: node test-db.js
*/
'use strict';
const { DatabaseSync } = require('node:sqlite');
import { DatabaseSync } from 'node:sqlite';
// --------------------------------------------------------
// Migrations-SQL direkt aus db.js extrahieren
// (Nur für Tests - in Produktion läuft db.js mit better-sqlite3)
// --------------------------------------------------------
const { MIGRATIONS_SQL } = require('./server/db-schema-test');
import { MIGRATIONS_SQL } from './server/db-schema-test.js';
let passed = 0;
let failed = 0;