otto-config
Advanced tools
Comparing version 0.0.4 to 0.1.0
@@ -19,2 +19,7 @@ | ||
// Default Config | ||
if (!config) { | ||
config = { logging : false }; | ||
} | ||
// Interpret Environment | ||
@@ -44,3 +49,3 @@ if (!environment) { environment = {}; } | ||
if (environment.NODE_ENV === 'DEVELOPMENT') { | ||
if (config.logging && config.logging !== false) { | ||
if (config.logging === true) { | ||
console.log('Starting Logger...'); | ||
@@ -47,0 +52,0 @@ // Long version of 'dev' |
{ | ||
"name" : "otto-config", | ||
"version" : "0.0.4", | ||
"version" : "0.1.0", | ||
"repository" : "https://github.com/ottojs/otto-config.git", | ||
"main" : "./lib/index.js", | ||
"dependencies" : { | ||
"morgan" : "1.2.2", | ||
"body-parser" : "1.6.4", | ||
"method-override" : "2.1.3" | ||
"morgan" : "1.5.0", | ||
"body-parser" : "1.9.3", | ||
"method-override" : "2.3.0" | ||
}, | ||
"devDependencies" : { | ||
"jshint" : "2.5.3", | ||
"mocha" : "1.21.4", | ||
"should" : "4.0.4", | ||
"supertest" : "0.13.0", | ||
"sinon" : "1.10.3", | ||
"istanbul" : "0.3.0" | ||
"jshint" : "2.5.10", | ||
"mocha" : "2.0.1", | ||
"should" : "4.3.0", | ||
"istanbul" : "0.3.2" | ||
}, | ||
@@ -23,5 +21,4 @@ "scripts" : { | ||
"engines" : { | ||
"node" : "0.10.x", | ||
"npm" : "1.4.x" | ||
"node" : "0.10.x" | ||
} | ||
} | ||
} |
@@ -101,3 +101,3 @@ | ||
it('should not run a logger in DEFAULT environment', function () { | ||
it('should not run a logger at all in DEFAULT environment', function () { | ||
@@ -118,3 +118,3 @@ var called = false; | ||
it('should run a logger in DEVELOPMENT environment', function () { | ||
it('should not run a logger by default in DEVELOPMENT environment', function () { | ||
@@ -131,2 +131,18 @@ var called = false; | ||
called.should.equal(false); | ||
}); | ||
it('should run a logger when asked in DEVELOPMENT environment', function () { | ||
var called = false; | ||
config.global({ | ||
set : function () {}, | ||
use : function (middleware) { | ||
if (function_name(middleware) === 'logger') { | ||
called = true; | ||
} | ||
} | ||
}, { NODE_ENV : 'DEVELOPMENT' }, { logging : true }); | ||
called.should.equal(true); | ||
@@ -133,0 +149,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8562
4
173
+ Addedbody-parser@1.9.3(transitive)
+ Addeddebug@2.1.3(transitive)
+ Addeddepd@1.0.1(transitive)
+ Addedee-first@1.1.0(transitive)
+ Addediconv-lite@0.4.5(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmethod-override@2.3.0(transitive)
+ Addedmime-db@1.12.0(transitive)
+ Addedmime-types@2.0.14(transitive)
+ Addedmorgan@1.5.0(transitive)
+ Addedms@0.7.0(transitive)
+ Addedon-finished@2.1.1(transitive)
+ Addedqs@2.3.3(transitive)
+ Addedraw-body@1.3.1(transitive)
+ Addedtype-is@1.5.7(transitive)
- Removedbody-parser@1.6.4(transitive)
- Removeddebug@1.0.4(transitive)
- Removeddepd@0.4.4(transitive)
- Removedee-first@1.0.3(transitive)
- Removedfinished@1.2.2(transitive)
- Removediconv-lite@0.4.4(transitive)
- Removedmedia-typer@0.2.0(transitive)
- Removedmethod-override@2.1.3(transitive)
- Removedmime-types@1.0.2(transitive)
- Removedmorgan@1.2.2(transitive)
- Removedms@0.6.2(transitive)
- Removedqs@1.2.2(transitive)
- Removedraw-body@1.3.0(transitive)
- Removedtype-is@1.3.2(transitive)
Updatedbody-parser@1.9.3
Updatedmethod-override@2.3.0
Updatedmorgan@1.5.0