Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pubsweet
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Julien Tremblay McLellan
pubsweet
Commits
f1df1d8f
Commit
f1df1d8f
authored
6 years ago
by
Jure
Browse files
Options
Downloads
Patches
Plain Diff
feat(jest-environment-db): update pg and reenable db deletion
parent
caed5beb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
packages/jest-environment-db/index.js
+8
-8
8 additions, 8 deletions
packages/jest-environment-db/index.js
packages/jest-environment-db/package.json
+1
-1
1 addition, 1 deletion
packages/jest-environment-db/package.json
with
9 additions
and
9 deletions
packages/jest-environment-db/index.js
+
8
−
8
View file @
f1df1d8f
...
@@ -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
()
}
}
...
...
This diff is collapsed.
Click to expand it.
packages/jest-environment-db/package.json
+
1
−
1
View file @
f1df1d8f
...
@@ -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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment