X-Git-Url: http://git.squeep.com/?a=blobdiff_plain;f=test%2Flib%2Ftemplate-helper.js;h=a21b141eaeec7e37c3429fa9b1ea2d268fd4bbcc;hb=e2c0fe7d1ab89eb892cad2f9003391c2e41010e7;hp=c0cd94851343de6a757fd7912ed85b72b7a4a6c7;hpb=2a4abfad091846a4fa528b44a31962c5150e6b0a;p=squeep-html-template-helper diff --git a/test/lib/template-helper.js b/test/lib/template-helper.js index c0cd948..a21b141 100644 --- a/test/lib/template-helper.js +++ b/test/lib/template-helper.js @@ -56,6 +56,11 @@ describe('Template Helper', function () { const result = th.dateFormat(undefined, undefined, undefined, expected); assert.strictEqual(result, expected); }); + it('handles invalid date', function () { + const expected = 'otherwise'; + const result = th.dateFormat(new Date('bad date'), undefined, undefined, expected); + assert.strictEqual(result, expected); + }); it('renders Infinity', function () { const expected = 'end of time'; const result = th.dateFormat(Infinity, expected);