Skip to content

Commit

Permalink
feat: Fixed tests timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
harazdovskiy committed Dec 27, 2022
1 parent 8205e11 commit 7926992
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
"preset": "./jest-preset.js"
},
"dependencies": {
"@shelf/postgres-local": "1.0.2",
"@shelf/postgres-local": "1.0.3",
"cwd": "0.10.0"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/setup.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import {start} from '@shelf/postgres-local';
import cwd from 'cwd';

const config = require(`${cwd()}/jest-postgres-config.js`);

module.exports = async function startPostgres() {
const config = require(`${cwd()}/jest-postgres-config.js`);
await start(config);

return true;
Expand Down
6 changes: 3 additions & 3 deletions src/teardown.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import {stop} from '@shelf/postgres-local';
import cwd from 'cwd';

module.exports = function stopPostgres() {
const config = require(`${cwd()}/jest-postgres-config.js`);
const config = require(`${cwd()}/jest-postgres-config.js`);

return stop(config);
module.exports = async function stopPostgres() {
await stop(config);
};
4 changes: 3 additions & 1 deletion test/client.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {getClient} from './client';
import {closeConnection, getClient} from './client';

describe('#getClient', () => {
const client = getClient({
Expand Down Expand Up @@ -29,5 +29,7 @@ describe('#getClient', () => {
vector: null,
},
]);

await closeConnection();
});
});

0 comments on commit 7926992

Please sign in to comment.