Fix jwt-token
This commit is contained in:
@@ -20,7 +20,7 @@ afterEach(() => {
|
||||
// Test database configuration
|
||||
const testDatabase = {
|
||||
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
|
||||
sync: { force: true } // Always recreate tables for tests
|
||||
};
|
||||
@@ -32,6 +32,9 @@ let models;
|
||||
* Setup test environment before all tests
|
||||
*/
|
||||
async function setupTestEnvironment() {
|
||||
// Clear any existing global models
|
||||
delete global.__TEST_MODELS__;
|
||||
|
||||
// Create test database connection
|
||||
sequelize = new Sequelize(testDatabase);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user