test.before(async t => {
t.timeout(30000, 'waiting for the database to be ready')
const initScript = resolve(__dirname, '..', '..', 'infrastructure', 'dev-schema.sql');
// @ts-ignore
t.context.pg = await new PostgreSqlContainer()
.withBindMounts([{
source: initScript,
target: '/docker-entrypoint-initdb.d/init.sql',
}])
.start();
// @ts-ignore
t.context.db = await prepareDb(t.context.pg.getConnectionUri())
// @ts-ignore
t.context.server = await prepareServer(t.context.db)
})
test.after.always(async t => {
try {
// @ts-ignore
await t.context.pg.stop({timeout: 500})
} catch (e) {
// swallow for now
}
})
test.before(async t => {
t.timeout(30000, 'waiting for the database to be ready')
const initScript = resolve(__dirname, '..', '..', 'infrastructure', 'dev-schema.sql');
// @ts-ignore
t.context.pg = await new PostgreSqlContainer()
.withBindMounts([{
source: initScript,
target: '/docker-entrypoint-initdb.d/init.sql',
}])
.start();
// @ts-ignore
t.context.db = await prepareDb(t.context.pg.getConnectionUri())
// @ts-ignore
t.context.server = await prepareServer(t.context.db)
})
test.after.always(async t => {
try {
// @ts-ignore
await t.context.pg.stop({timeout: 500})
} catch (e) {
// swallow for now
}
})