mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-14 05:07:22 +01:00
* start upgrade to node 8 * upgrade travis * improve travis * Remove bluebird, babel (except for modules) from server (WIP) (#9947) * remove bluebird, babel from server (except for modules) * fixes * fix path * fix path * fix export * fix export * fix test * fix tests * remove plugin for transform-object-rest-spread since it is supported in node8 * babel: correct syntax rest spread * remove bluebird * update migrations archive readme * fix package-lock.json * fix typo * add package-loc
20 lines
824 B
JavaScript
20 lines
824 B
JavaScript
/* eslint-disable no-process-env */
|
|
import nconf from 'nconf';
|
|
import mongoose from 'mongoose';
|
|
import setupNconf from '../../website/server/libs/setupNconf';
|
|
|
|
if (process.env.LOAD_SERVER === '0') { // when the server is in a different process we simply connect to mongoose
|
|
setupNconf('./config.json');
|
|
// Use Q promises instead of mpromise in mongoose
|
|
mongoose.connect(nconf.get('TEST_DB_URI'));
|
|
} else { // When running tests and the server in the same process
|
|
setupNconf('./config.json.example');
|
|
nconf.set('NODE_DB_URI', nconf.get('TEST_DB_URI'));
|
|
nconf.set('NODE_ENV', 'test');
|
|
nconf.set('IS_TEST', true);
|
|
// We require src/server and npt src/index because
|
|
// 1. nconf is already setup
|
|
// 2. we don't need clustering
|
|
require('../../website/server/server'); // eslint-disable-line global-require
|
|
}
|