19 lines
557 B
TypeScript
19 lines
557 B
TypeScript
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');
|
|
});
|
|
});
|