mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
test: silent migration test (#5131)
This commit is contained in:
parent
8bc04c59f3
commit
ab390dbaab
@ -1,9 +1,12 @@
|
|||||||
import { getDbConfig } from './helpers/database-config';
|
import { getDbConfig } from './helpers/database-config';
|
||||||
import { createTestConfig } from '../config/test-config';
|
import { createTestConfig } from '../config/test-config';
|
||||||
import { getInstance } from 'db-migrate';
|
import { getInstance } from 'db-migrate';
|
||||||
|
import { log } from 'db-migrate-shared';
|
||||||
import { Client } from 'pg';
|
import { Client } from 'pg';
|
||||||
import { IDBOption } from 'lib/types';
|
import { IDBOption } from 'lib/types';
|
||||||
|
|
||||||
|
log.setLogLevel('error');
|
||||||
|
|
||||||
async function initSchema(db: IDBOption): Promise<void> {
|
async function initSchema(db: IDBOption): Promise<void> {
|
||||||
const client = new Client(db);
|
const client = new Client(db);
|
||||||
await client.connect();
|
await client.connect();
|
||||||
@ -30,6 +33,8 @@ test('Up & down migrations work', async () => {
|
|||||||
connectionTimeoutMillis: 2000,
|
connectionTimeoutMillis: 2000,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// disable Intellij/WebStorm from setting verbose CLI argument to db-migrator
|
||||||
|
process.argv = process.argv.filter((it) => !it.includes('--verbose'));
|
||||||
const dbm = getInstance(true, {
|
const dbm = getInstance(true, {
|
||||||
cwd: `${__dirname}/../../`, // relative to src/test/e2e
|
cwd: `${__dirname}/../../`, // relative to src/test/e2e
|
||||||
config: { e2e },
|
config: { e2e },
|
||||||
|
Loading…
Reference in New Issue
Block a user