Skip to content

Commit b94e899

Browse files
committed
test(distiller): cover min and max aggregate getters in tests
1 parent 7a618bd commit b94e899

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/distiller.test.js

+10-8
Original file line numberDiff line numberDiff line change
@@ -449,6 +449,8 @@ describe('DataChunks', () => {
449449
assert.equal(totals.toptime.mean, 150);
450450
assert.equal(totals.clickcount.sum, 1);
451451
assert.equal(totals.clickcount.mean, 0.5);
452+
assert.equal(totals.clickcount.min, 0);
453+
assert.equal(totals.clickcount.max, 1);
452454
});
453455

454456
it('DataChunk.aggregate()', () => {
@@ -822,7 +824,7 @@ describe('DataChunks', () => {
822824
});
823825

824826
describe('DataChunks.hasConversion', () => {
825-
const chunks = [
827+
const testChunks = [
826828
{
827829
date: '2024-05-06',
828830
rumBundles: [
@@ -887,7 +889,7 @@ describe('DataChunks.hasConversion', () => {
887889

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

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

907909
it('unknown facet in filter spec', () => {
908910
const d = new DataChunks();
909-
d.load(chunks);
911+
d.load(testChunks);
910912

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

938940
// Add a cluster facet based on the 'url' facet
939941
d.addClusterFacet('urlCluster', 'url', {
940-
count: Math.log10(d.facets.url.length),
942+
count: Math.log10(d.facets.url.length),
941943
});
942944

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

955957
// Add a cluster facet based on the 'url' facet
956958
d.addClusterFacet('urlCluster', 'url', {
957-
count: Math.log10(d.facets.url.length),
959+
count: Math.log10(d.facets.url.length),
958960
});
959961

960962
const { facets } = d;
@@ -972,7 +974,7 @@ describe('DataChunks.addClusterFacet()', () => {
972974
// Add a cluster facet based on the 'url' facet
973975
const count = Math.floor(Math.log10(92));
974976
d.addClusterFacet('urlCluster', 'url', {
975-
count,
977+
count,
976978
});
977979

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

989991
// Add a cluster facet based on the 'url' facet
990992
d.addClusterFacet('urlCluster', 'url', {
991-
count: Math.log10(d.facets.url.length),
993+
count: Math.log10(d.facets.url.length),
992994
});
993995

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

0 commit comments

Comments
 (0)