projects
/
squeep-html-template-helper
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
dateFormat now handles bad dates a little better
[squeep-html-template-helper]
/
test
/
lib
/
template-helper.js
diff --git
a/test/lib/template-helper.js
b/test/lib/template-helper.js
index c0cd94851343de6a757fd7912ed85b72b7a4a6c7..a21b141eaeec7e37c3429fa9b1ea2d268fd4bbcc 100644
(file)
--- 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);
});
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);
it('renders Infinity', function () {
const expected = 'end of time';
const result = th.dateFormat(Infinity, expected);