Files
domain-driven-hexagon/tests/setup/jestGlobalSetup.ts
2022-10-10 17:24:43 +02:00

10 lines
402 B
TypeScript

import { databaseConfig } from '../../src/configs/database.config';
module.exports = async (): Promise<void> => {
if (!databaseConfig.database.includes('test')) {
throw new Error(
`Current database name is: ${databaseConfig.database}. Make sure database includes a word "test" as prefix or suffix, for example: "test_db" or "db_test" to avoid writing into a main database.`,
);
}
};