From 49e08bbc32a84da5d79e6b7e0fa74ff6217f6d81 Mon Sep 17 00:00:00 2001 From: Olaf Conijn Date: Thu, 13 Jul 2023 21:46:10 +0200 Subject: [PATCH] chore: added an additional testcase --- test.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test.js b/test.js index a523bb3..7ebf2ae 100644 --- a/test.js +++ b/test.js @@ -34,6 +34,10 @@ describe('wrap', function () { assert.equal(wrap(str, {trim: true}), 'A project without documentation is like a project\nthat doesn\'t exist. Verb solves this by making it\ndead simple to generate project documentation,\nusing simple markdown templates, with zero\nconfiguration required.'); }); + it('should trim trailing whitespace (even for empty lines):', function () { + assert.equal(wrap("a \n\nb \n \nc\t", {trim: true}), 'a\nb\nc'); + }); + it('should handle strings with just newlines', function () { assert.equal(wrap('\r\n', {indent: '\r\n', width: 18}), '\r\n'); });