Windshaft-cartodb/test/unit/utils/date-wrapper-test.js

21 lines
533 B
JavaScript
Raw Normal View History

'use strict';
2018-08-16 19:55:39 +08:00
var assert = require('assert');
2019-10-07 17:29:07 +08:00
var dateWrapper = require('../../../lib/utils/date-wrapper');
2018-08-16 19:55:39 +08:00
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);
});
});