console/integration-tests/jest-setup.ts
Kamil Kisiela dc3bc1ec87 Hello
2022-05-18 09:26:57 +02:00

20 lines
618 B
TypeScript

import { createPool } from 'slonik';
import * as utils from 'dockest/test-helper';
import { resetDb } from './testkit/db';
import { resetClickHouse } from './testkit/clickhouse';
import { resetRedis } from './testkit/redis';
const dbAddress = utils.getServiceAddress('db', 5432);
const redisAddress = utils.getServiceAddress('redis', 6379);
const pool = createPool(`postgresql://postgres:postgres@${dbAddress}/registry`);
beforeEach(() => resetDb(pool));
beforeEach(() => resetClickHouse());
beforeEach(() =>
resetRedis({
host: redisAddress.replace(':6379', ''),
port: 6379,
password: 'test',
})
);