Skip to content

Commit

Permalink
test(distiller): cover min and max aggregate getters in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
trieloff committed Dec 16, 2024
1 parent 7a618bd commit b94e899
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/distiller.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ describe('DataChunks', () => {
assert.equal(totals.toptime.mean, 150);
assert.equal(totals.clickcount.sum, 1);
assert.equal(totals.clickcount.mean, 0.5);
assert.equal(totals.clickcount.min, 0);
assert.equal(totals.clickcount.max, 1);
});

it('DataChunk.aggregate()', () => {
Expand Down Expand Up @@ -822,7 +824,7 @@ describe('DataChunks', () => {
});

describe('DataChunks.hasConversion', () => {
const chunks = [
const testChunks = [
{
date: '2024-05-06',
rumBundles: [
Expand Down Expand Up @@ -887,7 +889,7 @@ describe('DataChunks.hasConversion', () => {

it('will tag bundles with convert and not-convert based on a filter spec', () => {
const d = new DataChunks();
d.load(chunks);
d.load(testChunks);

const spec = {
facetOne: ['top'],
Expand All @@ -906,7 +908,7 @@ describe('DataChunks.hasConversion', () => {

it('unknown facet in filter spec', () => {
const d = new DataChunks();
d.load(chunks);
d.load(testChunks);

const spec = {
facetOne: ['top'],
Expand Down Expand Up @@ -937,7 +939,7 @@ describe('DataChunks.addClusterFacet()', () => {

// Add a cluster facet based on the 'url' facet
d.addClusterFacet('urlCluster', 'url', {
count: Math.log10(d.facets.url.length),
count: Math.log10(d.facets.url.length),
});

const { facets } = d;
Expand All @@ -954,7 +956,7 @@ describe('DataChunks.addClusterFacet()', () => {

// Add a cluster facet based on the 'url' facet
d.addClusterFacet('urlCluster', 'url', {
count: Math.log10(d.facets.url.length),
count: Math.log10(d.facets.url.length),
});

const { facets } = d;
Expand All @@ -972,7 +974,7 @@ describe('DataChunks.addClusterFacet()', () => {
// Add a cluster facet based on the 'url' facet
const count = Math.floor(Math.log10(92));
d.addClusterFacet('urlCluster', 'url', {
count,
count,
});

// Check if the count is correct
Expand All @@ -988,7 +990,7 @@ describe('DataChunks.addClusterFacet()', () => {

// Add a cluster facet based on the 'url' facet
d.addClusterFacet('urlCluster', 'url', {
count: Math.log10(d.facets.url.length),
count: Math.log10(d.facets.url.length),
});

const { facets } = d;
Expand All @@ -997,4 +999,4 @@ describe('DataChunks.addClusterFacet()', () => {
const mostOccurringCluster = facets.urlCluster[0];
assert.ok(mostOccurringCluster.value, '/developer');
});
});
});

0 comments on commit b94e899

Please sign in to comment.