forked from sheetjs/sheetjs
SheetJS
f335d310ac
- dateNF option for default date format override - general format renders undefined/null as empty string - ignore text elements when searching for decimal point - bubble negative sign to the front when format starts with text - fixes for eslint + closure - updated frac to 1.0.6 Issues: - fixes #10 h/t @adamgundy @SegFaultx64 @RichardCzechowski - fixes #15 h/t @wilg - fixes #25 h/t @dougschiller - fixes #26 h/t @rjmcguire
19 lines
663 B
JavaScript
19 lines
663 B
JavaScript
/* vim: set ts=2: */
|
|
/*jshint loopfunc:true, mocha:true, node:true */
|
|
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 handle special values', function() {
|
|
assert.equal(SSF.format("General", true), "TRUE");
|
|
assert.equal(SSF.format("General", undefined), "");
|
|
assert.equal(SSF.format("General", null), "");
|
|
});
|
|
});
|