Commit 61d14b26 authored by Alexandros Georgantas's avatar Alexandros Georgantas

rename wax folder

parent 99cb21fb
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits]( for commit guidelines.
<a name="1.0.0"></a>
# 1.0.0 (2018-02-23)
### Features
* switch to PostgreSQL ([d459299](
* All data is now persisted in a PostgreSQL database instead of PouchDB
* Database server must be running and have an existing database before running `pubsweet setupdb` (Docker config provided)
`pubsweet start` runs `npm start` script if found and falls back to `pubsweet server`
`pubsweet server` starts the PubSweet server (like the old `pubsweet start`)
`pubsweet-server` model API is unchanged
const NodeEnvironment = require('jest-environment-node')
const pg = require('pg')
const config = require('config')
class DatabaseTestEnvironment extends NodeEnvironment {
async setup() {
await super.setup()
this.db = new pg.Client(
config['pubsweet-server'] && config['pubsweet-server'].db,
await this.db.connect()
// pass the test database name into the test environment as a global = `test_${Math.floor(Math.random() * 9999999)}`
await this.db.query(`CREATE DATABASE ${}`)
async teardown() {
// terminate other connections from test before dropping db
await this.db.query(
await this.db.query(`
SELECT pg_terminate_backend(
FROM pg_stat_activity
WHERE pg_stat_activity.datname = '${}'`)
await this.db.query(`DROP DATABASE ${}`)
await super.teardown()
await this.db.end()
module.exports = DatabaseTestEnvironment
"name": "jest-environment-db",
"version": "1.0.1",
"description": "",
"main": "index.js",
"private": true,
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"jest-environment-node": "^22.1.4"
Markdown is supported
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