Fix jwt-token
This commit is contained in:
@@ -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 });
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user