chore(jest): custom db dialect option
This commit is contained in:
parent
6bf416d5c4
commit
31691e1f8e
@ -1,11 +1,19 @@
|
|||||||
import path from 'path';
|
|
||||||
import dotenv from 'dotenv';
|
import dotenv from 'dotenv';
|
||||||
|
import { existsSync } from 'fs';
|
||||||
|
import { resolve } from 'path';
|
||||||
import prettyFormat from 'pretty-format';
|
import prettyFormat from 'pretty-format';
|
||||||
|
import yargs from 'yargs';
|
||||||
|
|
||||||
|
const envFile = existsSync(resolve(__dirname, '.env.test')) ? '.env.test' : '.env';
|
||||||
|
|
||||||
dotenv.config({
|
dotenv.config({
|
||||||
path: path.resolve(__dirname, process.env.ENV_FILE || '.env'),
|
path: resolve(__dirname, envFile),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (yargs.argv.dbDialect) {
|
||||||
|
process.env.DB_DIALECT = yargs.argv.dbDialect as any;
|
||||||
|
}
|
||||||
|
|
||||||
global['prettyFormat'] = prettyFormat;
|
global['prettyFormat'] = prettyFormat;
|
||||||
|
|
||||||
jest.setTimeout(300000);
|
jest.setTimeout(300000);
|
||||||
|
Loading…
Reference in New Issue
Block a user