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

20 lines
548 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
2019-10-22 01:07:24 +08:00
describe('date-wrapper', function () {
it('should wrap property fields with spaces', function () {
2018-08-16 19:55:39 +08:00
const actual = dateWrapper.wrapDates(
2019-10-22 01:07:24 +08:00
'select * from table',
[{ name: 'a' }, { name: 'b c' }]
2018-08-16 19:55:39 +08:00
);
const expected = `
SELECT
"a","b c"
FROM
(select * from table) _cdb_epoch_transformation `;
assert.strictEqual(actual, expected);
2018-08-16 19:55:39 +08:00
});
});