2017-05-09 23:40:02 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const config = require('./config');
|
|
|
|
const log = require('npmlog');
|
|
|
|
const path = require('path');
|
|
|
|
const fs = require('fs');
|
|
|
|
|
2019-07-09 22:06:56 +00:00
|
|
|
if (process.env.NODE_ENV !== 'test' || !fs.existsSync(path.join(__dirname, '..', '..', '..', 'config', 'test.yaml'))) {
|
|
|
|
log.error('e2e', 'This script only runs in test and config/test.yaml (i.e. a dedicated test database) is present');
|
2017-05-09 23:40:02 +00:00
|
|
|
process.exit(1);
|
|
|
|
}
|
|
|
|
|
2018-11-17 01:54:23 +00:00
|
|
|
if (config.app.testServer.enabled !== true) {
|
2019-07-09 22:06:56 +00:00
|
|
|
log.error('e2e', 'This script only runs if the testServer is enabled. Check config/test.yaml');
|
2017-05-09 23:40:02 +00:00
|
|
|
process.exit(1);
|
|
|
|
}
|
2017-05-10 10:44:48 +00:00
|
|
|
|