Skip to content
Snippets Groups Projects
Commit f1df1d8f authored by Jure's avatar Jure
Browse files

feat(jest-environment-db): update pg and reenable db deletion

parent caed5beb
No related branches found
No related tags found
No related merge requests found
...@@ -26,14 +26,14 @@ class DatabaseTestEnvironment extends NodeEnvironment { ...@@ -26,14 +26,14 @@ class DatabaseTestEnvironment extends NodeEnvironment {
async teardown() { async teardown() {
// terminate other connections from test before dropping db // terminate other connections from test before dropping db
// await client.query( await client.query(
// `REVOKE CONNECT ON DATABASE ${this.global.__testDbName} FROM public`, `REVOKE CONNECT ON DATABASE ${this.global.__testDbName} FROM public`,
// ) )
// await client.query(` await client.query(`
// SELECT pg_terminate_backend(pg_stat_activity.pid) SELECT pg_terminate_backend(pg_stat_activity.pid)
// FROM pg_stat_activity FROM pg_stat_activity
// WHERE pg_stat_activity.datname = '${this.global.__testDbName}'`) WHERE pg_stat_activity.datname = '${this.global.__testDbName}'`)
// await client.query(`DROP DATABASE ${this.global.__testDbName}`) await client.query(`DROP DATABASE ${this.global.__testDbName}`)
await client.end() await client.end()
await super.teardown() await super.teardown()
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"jest-environment-node": "^22.1.4", "jest-environment-node": "^22.1.4",
"pg": "^7.7.1" "pg": "^7.8.0"
}, },
"peerDependencies": { "peerDependencies": {
"config": "^3.0.1" "config": "^3.0.1"
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment