X-Git-Url: http://git.squeep.com/?p=squeep-api-dingus;a=blobdiff_plain;f=test%2Flib%2Fcommon.js;h=a04bf614eeadac136f2df8ff44cf1519846d8221;hp=b802003af74c0a50d5a9ecf538c364df8eb682b7;hb=c980310d2de988d5f4e3c932eb77ebe83daa27b9;hpb=29837f0eeb9fcb4c53426e5bd89e9bdf7e9d961b diff --git a/test/lib/common.js b/test/lib/common.js index b802003..a04bf61 100644 --- a/test/lib/common.js +++ b/test/lib/common.js @@ -258,7 +258,6 @@ describe('common', function () { }); }); // requestId - describe('ensureLoggerLevels', function () { it('adds missing levels', function () { const result = common.ensureLoggerLevels(); @@ -378,4 +377,26 @@ describe('common', function () { }); }); // mergeDeep + describe('unfoldHeaderLines', function () { + it('folds', function () { + const lines = [ + 'Normal-Header: some header data', + 'Folded-Header: more data', + ' second line of data', + ' third line of data', + ]; + const expected = [ + 'Normal-Header: some header data', + 'Folded-Header: more data second line of data third line of data', + ]; + const result = common.unfoldHeaderLines(lines); + assert.deepStrictEqual(result, expected); + }); + it('covers no input', function () { + const lines = undefined; + const result = common.unfoldHeaderLines(); + assert.deepStrictEqual(result, lines); + }); + }); // unfoldHeaderLines + });