Fix jwt-token
This commit is contained in:
@@ -8,10 +8,10 @@ if (process.env.NODE_ENV !== 'test') {
|
||||
// Configure database based on environment
|
||||
let sequelize;
|
||||
if (process.env.NODE_ENV === 'test') {
|
||||
// Use SQLite in-memory database for testing
|
||||
// Use SQLite file database for testing to allow sharing between modules
|
||||
sequelize = new Sequelize({
|
||||
dialect: 'sqlite',
|
||||
storage: ':memory:',
|
||||
storage: './test.db',
|
||||
logging: false
|
||||
});
|
||||
} else {
|
||||
|
||||
@@ -20,7 +20,7 @@ afterEach(() => {
|
||||
// Test database configuration
|
||||
const testDatabase = {
|
||||
dialect: 'sqlite',
|
||||
storage: ':memory:', // In-memory database for fast tests
|
||||
storage: './test.db', // Use same file database as models/index.js
|
||||
logging: false, // Disable SQL logging in tests
|
||||
sync: { force: true } // Always recreate tables for tests
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user