improved coverage for date_format

This commit is contained in:
Gareth Jones
2013-06-17 16:00:42 +10:00
parent efc4e36317
commit 652888944b
2 changed files with 46 additions and 30 deletions

View File

@@ -19,6 +19,21 @@ vows.describe('date_format').addBatch({
dateFormat.asString(date),
'2010-01-11 14:31:30.005'
);
},
/* this test will only pass in Australia (GMT+11) - javascript doesn't
provide a way to change or specify a Date's timezone
'should provide a ISO8601 with timezone offset format': function(date) {
assert.equal(
dateFormat.asString(dateFormat.ISO8601_WITH_TZ_OFFSET_FORMAT, date),
"2010-01-11T14:31:30+1100"
);
},
*/
'should provide a just-the-time format': function(date) {
assert.equal(
dateFormat.asString(dateFormat.ABSOLUTETIME_FORMAT, date),
'14:31:30.005'
);
}
}
}).export(module);