Skip to content

Commit

Permalink
[Fix trentm#175] Additional test case logs through Env vars using obj…
Browse files Browse the repository at this point in the history
…ect.properties notation

This will exercise the case of references using the dot notation for the fix trentm#175.

*	modified:   test/log-env-disabled.test.js
- Adding a new env variable
- Adding the test case using the object.
  • Loading branch information
marcellodesales committed Oct 21, 2014
1 parent a3dea7d commit 4f3e71a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/log-env-disabled.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// Records that has this name will NOT be emitted.
process.env.BUNYAN_REC_DISABLE_name = "to-be-disabled";
process.env["BUNYAN_REC_DISABLE_fullName.first"] = "Marcello";

var util = require('util'),
format = util.format,
Expand Down Expand Up @@ -79,3 +80,21 @@ test('log.info(null, disabled by "name")', function (t) {
delete process.env.BUNYAN_REC_DISABLE_name;
t.end();
});

test('log.info(null, disabled by "object value")', function (t) {

var myObj = {
fullName: {
first: "Marcello",
last: "deSales"
}
};

names.forEach(function (lvl) {
log3[lvl].call(log3, myObj, 'some message');
var rec = catcher.records[catcher.records.length - 1];
t.notEqual(rec, 'undefined');
});
delete process.env.BUNYAN_REC_DISABLE_name;
t.end();
});

0 comments on commit 4f3e71a

Please sign in to comment.