Fix jwt-token

This commit is contained in:
2025-09-15 15:15:47 +02:00
parent 7211bfd78e
commit a73c8c058f

View File

@@ -103,7 +103,23 @@ async function teardownTestEnvironment() {
*/
async function cleanDatabase() {
if (sequelize) {
try {
// Drop all tables and recreate them
await sequelize.drop();
await sequelize.sync({ force: true });
// Verify tables are clean
const tableNames = Object.keys(sequelize.models);
for (const tableName of tableNames) {
const count = await sequelize.models[tableName].count();
if (count > 0) {
console.warn(`Warning: ${tableName} table not properly cleaned, has ${count} records`);
}
}
} catch (error) {
console.error('Error cleaning database:', error);
throw error;
}
}
}