Commit e4c76334 authored by Jure's avatar Jure Committed by Giannis Kopanas

chore: enable tests

parent 747976ce
...@@ -32,8 +32,7 @@ lint: ...@@ -32,8 +32,7 @@ lint:
- cd ${HOME} - cd ${HOME}
- npm run lint - npm run lint
# disable this job to make it clear we're not running any tests test:
.test:
image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA image: $IMAGE_ORG/$IMAGE_NAME:$CI_COMMIT_SHA
stage: test stage: test
variables: variables:
......
...@@ -4,8 +4,7 @@ const winston = require('winston') ...@@ -4,8 +4,7 @@ const winston = require('winston')
module.exports = { module.exports = {
'pubsweet-server': { 'pubsweet-server': {
db: { db: {
// temporary database name set by jest-environment-db database: 'test',
database: global.__testDbName || 'test',
}, },
ignoreTerminatedConnectionError: true, ignoreTerminatedConnectionError: true,
logger: new winston.Logger({ logger: new winston.Logger({
...@@ -15,9 +14,9 @@ module.exports = { ...@@ -15,9 +14,9 @@ module.exports = {
port: 4000, port: 4000,
secret: 'secret-string', secret: 'secret-string',
}, },
pubsweet: { // pubsweet: {
components: [], // There is something weird going on if there are components present. // components: [], // There is something weird going on if there are components present.
}, // },
baseUrl: deferConfig( baseUrl: deferConfig(
cfg => `http://localhost:${cfg['pubsweet-server'].port}`, cfg => `http://localhost:${cfg['pubsweet-server'].port}`,
), ),
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
"build": "NODE_ENV=production pubsweet build" "build": "NODE_ENV=production pubsweet build"
}, },
"jest": { "jest": {
"testEnvironment": "jest-environment-db", "testEnvironment": "node",
"testRegex": "/test/.*.test.js$", "testRegex": "/test/.*.test.js$",
"collectCoverage": true, "collectCoverage": true,
"collectCoverageFrom": ["src/**/*.js", "config/authsome.js"], "collectCoverageFrom": ["src/**/*.js", "config/authsome.js"],
......
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