dateFormat now handles bad dates a little better
[squeep-html-template-helper] / test / lib / template-helper.js
index c0cd94851343de6a757fd7912ed85b72b7a4a6c7..a21b141eaeec7e37c3429fa9b1ea2d268fd4bbcc 100644 (file)
@@ -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);