chore: configure angular and postgres foundation
This commit is contained in:
18
apps/api/src/config/database.config.spec.ts
Normal file
18
apps/api/src/config/database.config.spec.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { createDatabaseConfig } from './database.config';
|
||||
|
||||
describe('createDatabaseConfig', () => {
|
||||
it('uses postgres and permanently disables synchronization', () => {
|
||||
expect(
|
||||
createDatabaseConfig('postgresql://test:test@localhost/test'),
|
||||
).toMatchObject({
|
||||
type: 'postgres',
|
||||
url: 'postgresql://test:test@localhost/test',
|
||||
synchronize: false,
|
||||
autoLoadEntities: true,
|
||||
});
|
||||
});
|
||||
|
||||
it('rejects an empty database URL', () => {
|
||||
expect(() => createDatabaseConfig('')).toThrow('DATABASE_URL is required');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user