Skip to content

Commit 84b1078

Browse files
test(config): test load prod conf ✅
1 parent 2a25df4 commit 84b1078

3 files changed

Lines changed: 16 additions & 1 deletion

File tree

config/defaults/development.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
22
app: {
3-
title: 'WeAreOpenSource Node',
3+
title: 'WeAreOpenSource Node - Development Environment',
44
description: 'Full-Stack JavaScript with MongoDB, Express, AngularJS, and Node.js',
55
keywords: 'mongodb, express, angularjs, node.js, mongoose, passport',
66
googleAnalyticsTrackingID: 'WAOS_NODE_app_googleAnalyticsTrackingID',

config/defaults/production.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ const _ = require('lodash');
22
const defaultConfig = require('./development');
33

44
module.exports = _.merge(defaultConfig, {
5+
app: {
6+
title: 'WeAreOpenSource Node - Production Environment',
7+
},
58
host: '0.0.0.0',
69
db: {
710
uri: 'mongodb://localhost/WaosNode',

modules/core/tests/core.config.tests.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,18 @@ describe('Configuration Tests:', () => {
3535

3636
let originalLogConfig;
3737

38+
describe('Testing Configurations', () => {
39+
test('should load production configuration', async () => {
40+
try {
41+
const defaultConfig = require(path.join(process.cwd(), './config', 'defaults', 'production')) || {};
42+
expect(defaultConfig.app.title.split(' - ')[1]).toBe('Production Environment');
43+
} catch (err) {
44+
console.log(err);
45+
expect(err).toBeFalsy();
46+
}
47+
});
48+
});
49+
3850
describe('Testing default seedDB', () => {
3951
beforeAll((done) => {
4052
user1 = {

0 commit comments

Comments
 (0)