Fix jwt-token
This commit is contained in:
@@ -20,7 +20,7 @@ afterEach(() => {
|
|||||||
// Test database configuration
|
// Test database configuration
|
||||||
const testDatabase = {
|
const testDatabase = {
|
||||||
dialect: 'sqlite',
|
dialect: 'sqlite',
|
||||||
storage: './test.db', // Use same file database as models/index.js
|
storage: ':memory:', // Use in-memory database for fast tests
|
||||||
logging: false, // Disable SQL logging in tests
|
logging: false, // Disable SQL logging in tests
|
||||||
sync: { force: true } // Always recreate tables for tests
|
sync: { force: true } // Always recreate tables for tests
|
||||||
};
|
};
|
||||||
@@ -32,6 +32,9 @@ let models;
|
|||||||
* Setup test environment before all tests
|
* Setup test environment before all tests
|
||||||
*/
|
*/
|
||||||
async function setupTestEnvironment() {
|
async function setupTestEnvironment() {
|
||||||
|
// Clear any existing global models
|
||||||
|
delete global.__TEST_MODELS__;
|
||||||
|
|
||||||
// Create test database connection
|
// Create test database connection
|
||||||
sequelize = new Sequelize(testDatabase);
|
sequelize = new Sequelize(testDatabase);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user