From 4f3e71ac07d6e8f31e31644f58047d2da65642cc Mon Sep 17 00:00:00 2001 From: Marcello de Sales Date: Mon, 20 Oct 2014 17:33:27 -0700 Subject: [PATCH] [Fix #175] Additional test case logs through Env vars using object.properties notation This will exercise the case of references using the dot notation for the fix #175. * modified: test/log-env-disabled.test.js - Adding a new env variable - Adding the test case using the object. --- test/log-env-disabled.test.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/test/log-env-disabled.test.js b/test/log-env-disabled.test.js index ed9cdaa9..3b3f5ada 100644 --- a/test/log-env-disabled.test.js +++ b/test/log-env-disabled.test.js @@ -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, @@ -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(); +});