Fix jwt-token

This commit is contained in:
2025-09-15 05:18:01 +02:00
parent 82189050a3
commit ab04a3e776

View File

@@ -74,6 +74,15 @@ async function setupTestEnvironment() {
ManagementUser ManagementUser
}; };
// Override the main models module with our test models
// This ensures that when other modules import '../models', they get our test models
const mainModelsPath = path.resolve(__dirname, '../models/index.js');
require.cache[mainModelsPath] = {
exports: models,
loaded: true,
id: mainModelsPath
};
// Sync database // Sync database
await sequelize.sync({ force: true }); await sequelize.sync({ force: true });