From 30fa3da5e99441dedd62a775202e5d768013c98f Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 10 Feb 2016 00:03:21 -0800 Subject: [PATCH] node-bunyan#252 changelog and test case --- AUTHORS | 1 + CHANGES.md | 3 +++ test/cli.test.js | 19 +++++++++++++++++++ 3 files changed, 23 insertions(+) diff --git a/AUTHORS b/AUTHORS index b8e1ae2..10f7111 100644 --- a/AUTHORS +++ b/AUTHORS @@ -27,3 +27,4 @@ Guillermo Grau Panea (https://github.com/guigrpa) Mark LeMerise (https://github.com/MarkLeMerise) https://github.com/sometimesalready Charly Koza (https://github.com/Cactusbone) +Thomas Heymann (https://github.com/cyberthom) diff --git a/CHANGES.md b/CHANGES.md index 8fecc2f..d303f6f 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,9 @@ Known issues: ## 1.5.2 (not yet released) +- [pull #252] Fix errant `client_res={}` in `bunyan` CLI rendering, and avoid + extra newlines in `client_req` rendering in some cases. (By Thomas Heymann.) + - [pull #291, issue #303] Fix `LOG.child(...)` to *not* override the "hostname" field of the parent. A use case is when one manually sets "hostname" to something other than `os.hostname()`. (By github.com/Cactusbone.) diff --git a/test/cli.test.js b/test/cli.test.js index 40fd959..c26c7a0 100644 --- a/test/cli.test.js +++ b/test/cli.test.js @@ -424,3 +424,22 @@ test('should not crash on corpus/old-crashers/*.log', function (t) { t.end(); }); }); + +test('client_req extra newlines, client_res={} (pull #252)', function (t) { + var expect = [ + /* BEGIN JSSTYLED */ + '[2016-02-10T07:28:40.510Z] TRACE: aclientreq/23280 on danger0.local: request sent', + ' GET /--ping HTTP/1.1', + '[2016-02-10T07:28:41.419Z] TRACE: aclientreq/23280 on danger0.local: Response received', + ' HTTP/1.1 200 OK', + ' request-id: e8a5a700-cfc7-11e5-a3dc-3b85d20f26ef', + ' content-type: application/json' + /* END JSSTYLED */ + ].join('\n') + '\n'; + exec(_('%s %s/corpus/clientreqres.log', BUNYAN, __dirname), + function (err, stdout, stderr) { + t.ifError(err); + t.equal(stdout, expect); + t.end(); + }); +});