Add unit test

This commit is contained in:
Jesús Arroyo Torrens
2018-08-16 14:15:28 +02:00
parent 925328c43b
commit 31263b7b22
@@ -0,0 +1,18 @@
var assert = require('assert');
var dateWrapper = require('../../../../lib/cartodb/utils/date-wrapper');
describe('date-wrapper', function() {
it('should wrap property fields with spaces', function() {
const actual = dateWrapper.wrapDates(
'select * from table',
[{name: 'a'}, {name: 'b c'}]
);
const expected = `
SELECT
"a","b c"
FROM
(select * from table) _cdb_epoch_transformation `;
assert.equal(actual, expected);
});
});