diff --git a/config/defaults/development.js b/config/defaults/development.js index 766882da..1584a3b0 100644 --- a/config/defaults/development.js +++ b/config/defaults/development.js @@ -1,6 +1,6 @@ module.exports = { app: { - title: 'WeAreOpenSource Node', + title: 'WeAreOpenSource Node - Development Environment', description: 'Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js', keywords: 'mongodb, express, angularjs, node.js, mongoose, passport', googleAnalyticsTrackingID: 'WAOS_NODE_app_googleAnalyticsTrackingID', diff --git a/config/defaults/production.js b/config/defaults/production.js index 8a11bb88..c8825e14 100644 --- a/config/defaults/production.js +++ b/config/defaults/production.js @@ -2,6 +2,9 @@ const _ = require('lodash'); const defaultConfig = require('./development'); module.exports = _.merge(defaultConfig, { + app: { + title: 'WeAreOpenSource Node - Production Environment', + }, host: '0.0.0.0', db: { uri: 'mongodb://localhost/WaosNode', diff --git a/modules/core/tests/core.config.tests.js b/modules/core/tests/core.config.tests.js index 25d0ef96..61d94ab3 100644 --- a/modules/core/tests/core.config.tests.js +++ b/modules/core/tests/core.config.tests.js @@ -35,6 +35,18 @@ describe('Configuration Tests:', () => { let originalLogConfig; + describe('Testing Configurations', () => { + test('should load production configuration', async () => { + try { + const defaultConfig = require(path.join(process.cwd(), './config', 'defaults', 'production')) || {}; + expect(defaultConfig.app.title.split(' - ')[1]).toBe('Production Environment'); + } catch (err) { + console.log(err); + expect(err).toBeFalsy(); + } + }); + }); + describe('Testing default seedDB', () => { beforeAll((done) => { user1 = {