feat: Add types knex field of global
This commit is contained in:
@@ -1,12 +1,11 @@
|
||||
import { client as knex } from '../../src/config/database';
|
||||
import { Knex } from 'knex';
|
||||
|
||||
global.beforeAll(async () => {
|
||||
(global as any).knex = knex as Knex;
|
||||
global.knex = knex;
|
||||
});
|
||||
|
||||
global.beforeEach(async function () {
|
||||
this.transaction = await (global as any).knex.transaction();
|
||||
this.transaction = await global.knex.transaction();
|
||||
});
|
||||
|
||||
global.afterEach(async function () {
|
||||
@@ -14,5 +13,5 @@ global.afterEach(async function () {
|
||||
});
|
||||
|
||||
global.afterAll(async () => {
|
||||
(global as any).knex.destroy();
|
||||
global.knex.destroy();
|
||||
});
|
||||
|
Reference in New Issue
Block a user