sheetjs-clone/test/general.js
SheetJS b0b3ffea84 version bump 0.5.2: cleanup
more formats:
o fractional seconds
o absolute time formats
o generalized engineering notation
o better resolution in splitting format strings
o support for LO uppercase date+time formats

other changes
- no more prototype pollution
- many many more tests
- passes jshint
- code coverage: blanket + coveralls + travis
- npmignore test files
2014-01-20 03:37:48 -05:00

19 lines
572 B
JavaScript

/* vim: set ts=2: */
var SSF = require('../');
var fs = require('fs'), assert = require('assert');
var data = JSON.parse(fs.readFileSync('./test/general.json','utf8'));
var skip = [];
describe('General format', function() {
data.forEach(function(d) {
it(d[1]+" for "+d[0], skip.indexOf(d[1]) > -1 ? null : function(){
assert.equal(SSF.format(d[1], d[0], {}), d[2]);
});
});
it('should fail for undefined and null', function() {
assert.throws(function() {
SSF.format("General", undefined);
SSF.format("General", null);
});
});
});