2022-02-15 11:02:56 +08:00
|
|
|
const dotenv = require('dotenv');
|
|
|
|
const { existsSync } = require('fs');
|
|
|
|
const { resolve } = require('path')
|
2022-02-15 09:54:57 +08:00
|
|
|
const yargs = require('yargs');
|
|
|
|
|
2022-02-15 11:02:56 +08:00
|
|
|
const envFile = existsSync(resolve(__dirname, '.env.test')) ? '.env.test' : '.env';
|
|
|
|
|
|
|
|
dotenv.config({
|
|
|
|
path: resolve(__dirname, envFile),
|
|
|
|
});
|
|
|
|
|
2022-02-15 09:54:57 +08:00
|
|
|
if (yargs.argv.dbDialect) {
|
|
|
|
process.env.DB_DIALECT = yargs.argv.dbDialect;
|
|
|
|
}
|
|
|
|
|
|
|
|
console.log('DB_DIALECT: ', process.env.DB_DIALECT);
|
|
|
|
|
|
|
|
require('jest-cli/bin/jest');
|