Going green: do not rely on falsy conditional

This commit is contained in:
Daniel García Aubert 2017-08-03 18:23:55 +02:00
parent 6c063095a3
commit 48ad7059e1
2 changed files with 2 additions and 3 deletions

View File

@ -589,7 +589,7 @@ Histogram.prototype.format = function(result, override) {
nans = firstRow.nans_count;
binsStart = populateBinStart(override, firstRow);
if (timestampStart) {
if (Number.isFinite(timestampStart)) {
aggregation = getAggregation(override, this.aggregation);
offset = getOffset(override, this.offset);
}

View File

@ -949,11 +949,10 @@ describe('histogram-dates: timestamp starts at epoch', function() {
this.testClient.getDataview('epoch_start_histogram', override, function(err, dataview) {
assert.ifError(err);
console.log(dataview);
const { aggregation, timestamp_start } = dataview;
assert.equal(timestamp_start, 0);
assert.equal(aggregation, 'quarter');
assert.equal(aggregation, 'month');
done();
});