From 7938868e0a19b5594bbfc0b4df928bd912dd2d12 Mon Sep 17 00:00:00 2001 From: Jitse De Smet Date: Fri, 5 Apr 2024 11:13:05 +0200 Subject: [PATCH] fix large part of aggeragtor tests --- ...orBindingsAggregatorFactoryAverage-test.ts | 21 ++++++++++--------- .../test/AverageAggregator-test.ts | 21 ++++++++++++------- ...ctorBindingsAggregatorFactoryCount-test.ts | 20 ++++++++---------- .../test/CountAggregator-test.ts | 17 ++++++++------- ...ndingsAggregatorFactoryGroupConcat-test.ts | 19 ++++++++--------- .../test/GroupConcatAggregator-test.ts | 19 +++++++++-------- .../ActorBindingsAggregatorFactoryMax-test.ts | 15 +++++-------- .../test/MaxAggregator-test.ts | 20 +++++++++++------- .../ActorBindingsAggregatorFactoryMin-test.ts | 19 ++++++++--------- .../test/MinAggregator-test.ts | 17 ++++++++------- ...torBindingsAggregatorFactorySample-test.ts | 19 ++++++++--------- .../test/SampleAggregator-test.ts | 17 ++++++++------- .../ActorBindingsAggregatorFactorySum-test.ts | 21 ++++++++++--------- .../test/SumAggeregator-test.ts | 20 +++++++++++------- ...ingsAggregatorFactoryWildcardCount-test.ts | 21 ++++++++----------- .../test/WildcardCountAggregator-test.ts | 19 +++++++++-------- 16 files changed, 162 insertions(+), 143 deletions(-) diff --git a/packages/actor-bindings-aggregator-factory-average/test/ActorBindingsAggregatorFactoryAverage-test.ts b/packages/actor-bindings-aggregator-factory-average/test/ActorBindingsAggregatorFactoryAverage-test.ts index 985f078fc4..ebb5595092 100644 --- a/packages/actor-bindings-aggregator-factory-average/test/ActorBindingsAggregatorFactoryAverage-test.ts +++ b/packages/actor-bindings-aggregator-factory-average/test/ActorBindingsAggregatorFactoryAverage-test.ts @@ -1,13 +1,13 @@ +import { createFuncMediator } from '@comunica/actor-functions-wrapper-all/test/util'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactoryAverage } from '../lib'; describe('ActorBindingsAggregatorFactoryAverage', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,9 +25,10 @@ describe('ActorBindingsAggregatorFactoryAverage', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, + mediatorFunctions: createFuncMediator(), }); }); @@ -35,13 +36,16 @@ describe('ActorBindingsAggregatorFactoryAverage', () => { let actor: ActorBindingsAggregatorFactoryAverage; beforeEach(() => { - actor = new ActorBindingsAggregatorFactoryAverage({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactoryAverage({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('accepts average 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('avg', false), })).resolves.toEqual({}); @@ -49,7 +53,6 @@ describe('ActorBindingsAggregatorFactoryAverage', () => { it('accepts average 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('avg', true), })).resolves.toEqual({}); @@ -57,7 +60,6 @@ describe('ActorBindingsAggregatorFactoryAverage', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -66,7 +68,6 @@ describe('ActorBindingsAggregatorFactoryAverage', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('avg', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-average/test/AverageAggregator-test.ts b/packages/actor-bindings-aggregator-factory-average/test/AverageAggregator-test.ts index 6812c1572d..ba902b3355 100644 --- a/packages/actor-bindings-aggregator-factory-average/test/AverageAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-average/test/AverageAggregator-test.ts @@ -1,8 +1,10 @@ +import { createFuncMediator } from '@comunica/actor-functions-wrapper-all/test/util'; import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory, RegularOperator } from '@comunica/expression-evaluator'; -import { BF, decimal, DF, double, float, int, makeAggregate } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { RegularOperator } from '@comunica/expression-evaluator'; +import { BF, decimal, DF, double, float, getMockEEFactory, int, makeAggregate } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { AverageAggregator } from '../lib/AverageAggregator'; @@ -15,12 +17,15 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; }): Promise { return new AverageAggregator( - await expressionEvaluatorFactory.createEvaluator(makeAggregate('avg', distinct).expression, context), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('avg', distinct).expression, + context, + })).expressionEvaluator, distinct, await expressionEvaluatorFactory.createFunction({ context, @@ -36,7 +41,7 @@ async function createAggregator({ expressionEvaluatorFactory, context, distinct } describe('AverageAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -53,9 +58,10 @@ describe('AverageAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, + mediatorFunctions: createFuncMediator(), }); context = new ActionContext(); @@ -139,3 +145,4 @@ describe('AverageAggregator', () => { }); }); }); + diff --git a/packages/actor-bindings-aggregator-factory-count/test/ActorBindingsAggregatorFactoryCount-test.ts b/packages/actor-bindings-aggregator-factory-count/test/ActorBindingsAggregatorFactoryCount-test.ts index dbc951c55e..987397ee5c 100644 --- a/packages/actor-bindings-aggregator-factory-count/test/ActorBindingsAggregatorFactoryCount-test.ts +++ b/packages/actor-bindings-aggregator-factory-count/test/ActorBindingsAggregatorFactoryCount-test.ts @@ -1,14 +1,13 @@ +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { getMockEEFactory, makeAggregate } from '@comunica/jest'; import { Algebra } from 'sparqlalgebrajs'; import { Wildcard } from 'sparqljs'; import { ActorBindingsAggregatorFactoryCount } from '../lib'; describe('ActorExpressionEvaluatorAggregateCount', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -17,7 +16,7 @@ describe('ActorExpressionEvaluatorAggregateCount', () => { async mediate(arg: any) { return {}; }, }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); @@ -27,13 +26,16 @@ describe('ActorExpressionEvaluatorAggregateCount', () => { let actor: ActorBindingsAggregatorFactoryCount; beforeEach(() => { - actor = new ActorBindingsAggregatorFactoryCount({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactoryCount({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('accepts count 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', false), })).resolves.toEqual({}); @@ -41,7 +43,6 @@ describe('ActorExpressionEvaluatorAggregateCount', () => { it('accepts count 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', true), })).resolves.toEqual({}); @@ -49,7 +50,6 @@ describe('ActorExpressionEvaluatorAggregateCount', () => { it('rejects wildcard', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: { type: Algebra.types.EXPRESSION, @@ -68,7 +68,6 @@ describe('ActorExpressionEvaluatorAggregateCount', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -77,7 +76,6 @@ describe('ActorExpressionEvaluatorAggregateCount', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-count/test/CountAggregator-test.ts b/packages/actor-bindings-aggregator-factory-count/test/CountAggregator-test.ts index 4214063bf2..26d2850702 100644 --- a/packages/actor-bindings-aggregator-factory-count/test/CountAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-count/test/CountAggregator-test.ts @@ -1,8 +1,8 @@ import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, int, makeAggregate } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, int, makeAggregate } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { CountAggregator } from '../lib'; @@ -15,18 +15,21 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; }): Promise { return new CountAggregator( - await expressionEvaluatorFactory.createEvaluator(makeAggregate('count', distinct).expression, context), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('count', distinct).expression, + context, + })).expressionEvaluator, distinct, ); } describe('CountAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -43,7 +46,7 @@ describe('CountAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); diff --git a/packages/actor-bindings-aggregator-factory-group-concat/test/ActorBindingsAggregatorFactoryGroupConcat-test.ts b/packages/actor-bindings-aggregator-factory-group-concat/test/ActorBindingsAggregatorFactoryGroupConcat-test.ts index de65cd9022..47ca97eca5 100644 --- a/packages/actor-bindings-aggregator-factory-group-concat/test/ActorBindingsAggregatorFactoryGroupConcat-test.ts +++ b/packages/actor-bindings-aggregator-factory-group-concat/test/ActorBindingsAggregatorFactoryGroupConcat-test.ts @@ -1,13 +1,12 @@ +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactoryGroupConcat } from '../lib'; describe('ActorBindingsAggregatorFactoryGroupConcat', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,7 +24,7 @@ describe('ActorBindingsAggregatorFactoryGroupConcat', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); @@ -35,13 +34,16 @@ describe('ActorBindingsAggregatorFactoryGroupConcat', () => { let actor: ActorBindingsAggregatorFactoryGroupConcat; beforeEach(() => { - actor = new ActorBindingsAggregatorFactoryGroupConcat({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactoryGroupConcat({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('accepts group_concat 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('group_concat', false), })).resolves.toEqual({}); @@ -49,7 +51,6 @@ describe('ActorBindingsAggregatorFactoryGroupConcat', () => { it('accepts group_concat 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('group_concat', true), })).resolves.toEqual({}); @@ -57,7 +58,6 @@ describe('ActorBindingsAggregatorFactoryGroupConcat', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -66,7 +66,6 @@ describe('ActorBindingsAggregatorFactoryGroupConcat', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('group_concat', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-group-concat/test/GroupConcatAggregator-test.ts b/packages/actor-bindings-aggregator-factory-group-concat/test/GroupConcatAggregator-test.ts index 601c1a9679..c6bddbe4d0 100644 --- a/packages/actor-bindings-aggregator-factory-group-concat/test/GroupConcatAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-group-concat/test/GroupConcatAggregator-test.ts @@ -1,8 +1,8 @@ import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, int, makeAggregate } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, int, makeAggregate } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { GroupConcatAggregator } from '../lib/GroupConcatAggregator'; @@ -15,21 +15,22 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct, separator }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; separator?: string; }): Promise { return new GroupConcatAggregator( - await expressionEvaluatorFactory.createEvaluator( - makeAggregate('group_concat', distinct, separator).expression, context, - ), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('group_concat', distinct, separator).expression, + context, + })).expressionEvaluator, distinct, separator, ); } describe('CountAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -46,7 +47,7 @@ describe('CountAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); diff --git a/packages/actor-bindings-aggregator-factory-max/test/ActorBindingsAggregatorFactoryMax-test.ts b/packages/actor-bindings-aggregator-factory-max/test/ActorBindingsAggregatorFactoryMax-test.ts index a7a7762d8b..4bbe379341 100644 --- a/packages/actor-bindings-aggregator-factory-max/test/ActorBindingsAggregatorFactoryMax-test.ts +++ b/packages/actor-bindings-aggregator-factory-max/test/ActorBindingsAggregatorFactoryMax-test.ts @@ -1,13 +1,12 @@ +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactoryMax } from '../lib'; describe('ActorBindingsAggregatorFactoryMax', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,7 +24,7 @@ describe('ActorBindingsAggregatorFactoryMax', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); @@ -35,13 +34,12 @@ describe('ActorBindingsAggregatorFactoryMax', () => { let actor: ActorBindingsAggregatorFactoryMax; beforeEach(() => { - actor = new ActorBindingsAggregatorFactoryMax({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactoryMax({ name: 'actor', bus, factory: expressionEvaluatorFactory }); }); describe('test', () => { it('accepts max 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('max', false), })).resolves.toEqual({}); @@ -49,7 +47,6 @@ describe('ActorBindingsAggregatorFactoryMax', () => { it('accepts max 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('max', true), })).resolves.toEqual({}); @@ -57,7 +54,6 @@ describe('ActorBindingsAggregatorFactoryMax', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -66,7 +62,6 @@ describe('ActorBindingsAggregatorFactoryMax', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('max', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-max/test/MaxAggregator-test.ts b/packages/actor-bindings-aggregator-factory-max/test/MaxAggregator-test.ts index cb92ec2bbd..de6517778b 100644 --- a/packages/actor-bindings-aggregator-factory-max/test/MaxAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-max/test/MaxAggregator-test.ts @@ -1,8 +1,9 @@ +import { createFuncMediator } from '@comunica/actor-functions-wrapper-all/test/util'; import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, date, DF, double, float, int, makeAggregate, nonLiteral, string } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, date, DF, double, float, getMockEEFactory, int, makeAggregate, nonLiteral, string } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { MaxAggregator } from '../lib'; @@ -15,13 +16,16 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct, throwError }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; throwError?: boolean; }): Promise { return new MaxAggregator( - await expressionEvaluatorFactory.createEvaluator(makeAggregate('max', distinct).expression, context), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('max', distinct).expression, + context, + })).expressionEvaluator, distinct, await expressionEvaluatorFactory.createTermComparator({ context }), throwError, @@ -29,7 +33,7 @@ async function createAggregator({ expressionEvaluatorFactory, context, distinct, } describe('MaxAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -46,9 +50,11 @@ describe('MaxAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, + // TODO: needs to get the comarator mediator! + mediatorFunctions: createFuncMediator(), }); context = new ActionContext(); diff --git a/packages/actor-bindings-aggregator-factory-min/test/ActorBindingsAggregatorFactoryMin-test.ts b/packages/actor-bindings-aggregator-factory-min/test/ActorBindingsAggregatorFactoryMin-test.ts index e60adff1a3..fc22d7e6f5 100644 --- a/packages/actor-bindings-aggregator-factory-min/test/ActorBindingsAggregatorFactoryMin-test.ts +++ b/packages/actor-bindings-aggregator-factory-min/test/ActorBindingsAggregatorFactoryMin-test.ts @@ -1,13 +1,12 @@ +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactoryMin } from '../lib'; describe('ActorBindingsAggregatorFactoryMin', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,7 +24,7 @@ describe('ActorBindingsAggregatorFactoryMin', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); @@ -35,13 +34,16 @@ describe('ActorBindingsAggregatorFactoryMin', () => { let actor: ActorBindingsAggregatorFactoryMin; beforeEach(() => { - actor = new ActorBindingsAggregatorFactoryMin({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactoryMin({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('accepts min 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('min', false), })).resolves.toEqual({}); @@ -49,7 +51,6 @@ describe('ActorBindingsAggregatorFactoryMin', () => { it('accepts min 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('min', true), })).resolves.toEqual({}); @@ -57,7 +58,6 @@ describe('ActorBindingsAggregatorFactoryMin', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -66,7 +66,6 @@ describe('ActorBindingsAggregatorFactoryMin', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('min', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-min/test/MinAggregator-test.ts b/packages/actor-bindings-aggregator-factory-min/test/MinAggregator-test.ts index fc76b8fb43..15c636c808 100644 --- a/packages/actor-bindings-aggregator-factory-min/test/MinAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-min/test/MinAggregator-test.ts @@ -1,8 +1,8 @@ import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, date, DF, double, float, int, makeAggregate, nonLiteral, string } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, date, DF, double, float, getMockEEFactory, int, makeAggregate, nonLiteral, string } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { MinAggregator } from '../lib/MinAggregator'; @@ -15,20 +15,23 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct, throwError }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; throwError?: boolean; }): Promise { return new MinAggregator( - await expressionEvaluatorFactory.createEvaluator(makeAggregate('min', distinct).expression, context), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('min', distinct).expression, + context, + })).expressionEvaluator, distinct, await expressionEvaluatorFactory.createTermComparator({ context }), throwError, ); } describe('MinAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -45,7 +48,7 @@ describe('MinAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); diff --git a/packages/actor-bindings-aggregator-factory-sample/test/ActorBindingsAggregatorFactorySample-test.ts b/packages/actor-bindings-aggregator-factory-sample/test/ActorBindingsAggregatorFactorySample-test.ts index 330728630c..e187218ed9 100644 --- a/packages/actor-bindings-aggregator-factory-sample/test/ActorBindingsAggregatorFactorySample-test.ts +++ b/packages/actor-bindings-aggregator-factory-sample/test/ActorBindingsAggregatorFactorySample-test.ts @@ -1,13 +1,12 @@ +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactorySample } from '../lib'; describe('ActorBindingsAggregatorFactorySample', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,7 +24,7 @@ describe('ActorBindingsAggregatorFactorySample', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); @@ -35,13 +34,16 @@ describe('ActorBindingsAggregatorFactorySample', () => { let actor: ActorBindingsAggregatorFactorySample; beforeEach(() => { - actor = new ActorBindingsAggregatorFactorySample({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactorySample({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('accepts sample 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sample', false), })).resolves.toEqual({}); @@ -49,7 +51,6 @@ describe('ActorBindingsAggregatorFactorySample', () => { it('accepts sample 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sample', true), })).resolves.toEqual({}); @@ -57,7 +58,6 @@ describe('ActorBindingsAggregatorFactorySample', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -66,7 +66,6 @@ describe('ActorBindingsAggregatorFactorySample', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sample', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-sample/test/SampleAggregator-test.ts b/packages/actor-bindings-aggregator-factory-sample/test/SampleAggregator-test.ts index 932db80d5b..aa513f7f54 100644 --- a/packages/actor-bindings-aggregator-factory-sample/test/SampleAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-sample/test/SampleAggregator-test.ts @@ -1,8 +1,8 @@ import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, int, makeAggregate } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, int, makeAggregate } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { SampleAggregator } from '../lib'; @@ -15,17 +15,20 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; }): Promise { return new SampleAggregator( - await expressionEvaluatorFactory.createEvaluator(makeAggregate('sample', distinct).expression, context), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('sample', distinct).expression, + context, + })).expressionEvaluator, distinct, ); } describe('SampleAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -42,7 +45,7 @@ describe('SampleAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); diff --git a/packages/actor-bindings-aggregator-factory-sum/test/ActorBindingsAggregatorFactorySum-test.ts b/packages/actor-bindings-aggregator-factory-sum/test/ActorBindingsAggregatorFactorySum-test.ts index cb015cbb06..0a4435b8ed 100644 --- a/packages/actor-bindings-aggregator-factory-sum/test/ActorBindingsAggregatorFactorySum-test.ts +++ b/packages/actor-bindings-aggregator-factory-sum/test/ActorBindingsAggregatorFactorySum-test.ts @@ -1,13 +1,13 @@ +import { createFuncMediator } from '@comunica/actor-functions-wrapper-all/test/util'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactorySum } from '../lib'; describe('ActorBindingsAggregatorFactorySum', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,9 +25,10 @@ describe('ActorBindingsAggregatorFactorySum', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, + mediatorFunctions: createFuncMediator(), }); }); @@ -35,13 +36,16 @@ describe('ActorBindingsAggregatorFactorySum', () => { let actor: ActorBindingsAggregatorFactorySum; beforeEach(() => { - actor = new ActorBindingsAggregatorFactorySum({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactorySum({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('accepts sum 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).resolves.toEqual({}); @@ -49,7 +53,6 @@ describe('ActorBindingsAggregatorFactorySum', () => { it('accepts sum 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', true), })).resolves.toEqual({}); @@ -57,7 +60,6 @@ describe('ActorBindingsAggregatorFactorySum', () => { it('rejects count', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', false), })).rejects.toThrow(); @@ -66,7 +68,6 @@ describe('ActorBindingsAggregatorFactorySum', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-sum/test/SumAggeregator-test.ts b/packages/actor-bindings-aggregator-factory-sum/test/SumAggeregator-test.ts index 9914a2f780..2fce531fad 100644 --- a/packages/actor-bindings-aggregator-factory-sum/test/SumAggeregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-sum/test/SumAggeregator-test.ts @@ -1,8 +1,10 @@ +import { createFuncMediator } from '@comunica/actor-functions-wrapper-all/test/util'; import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory, RegularOperator } from '@comunica/expression-evaluator'; -import { BF, decimal, DF, float, int, makeAggregate, nonLiteral } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { RegularOperator } from '@comunica/expression-evaluator'; +import { BF, decimal, DF, float, getMockEEFactory, int, makeAggregate, nonLiteral } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { SumAggregator } from '../lib'; @@ -15,12 +17,15 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; }): Promise { return new SumAggregator( - await expressionEvaluatorFactory.createEvaluator(makeAggregate('sum', distinct).expression, context), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('sum', distinct).expression, + context, + })).expressionEvaluator, distinct, await expressionEvaluatorFactory.createFunction({ context, @@ -31,7 +36,7 @@ async function createAggregator({ expressionEvaluatorFactory, context, distinct } describe('SumAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -48,9 +53,10 @@ describe('SumAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, + mediatorFunctions: createFuncMediator(), }); context = new ActionContext(); diff --git a/packages/actor-bindings-aggregator-factory-wildcard-count/test/ActorBindingsAggregatorFactoryWildcardCount-test.ts b/packages/actor-bindings-aggregator-factory-wildcard-count/test/ActorBindingsAggregatorFactoryWildcardCount-test.ts index e7f6dbeb8b..c405311b73 100644 --- a/packages/actor-bindings-aggregator-factory-wildcard-count/test/ActorBindingsAggregatorFactoryWildcardCount-test.ts +++ b/packages/actor-bindings-aggregator-factory-wildcard-count/test/ActorBindingsAggregatorFactoryWildcardCount-test.ts @@ -1,13 +1,12 @@ +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext, Bus } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, makeAggregate } from '@comunica/jest'; -import type { IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, makeAggregate } from '@comunica/jest'; import { ArrayIterator } from 'asynciterator'; import { ActorBindingsAggregatorFactoryWildcardCount } from '../lib'; describe('ActorBindingsAggregatorFactoryWildcardCount', () => { let bus: any; - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; beforeEach(() => { bus = new Bus({ name: 'bus' }); @@ -25,7 +24,7 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, }); @@ -35,13 +34,16 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { let actor: ActorBindingsAggregatorFactoryWildcardCount; beforeEach(() => { - actor = new ActorBindingsAggregatorFactoryWildcardCount({ name: 'actor', bus }); + actor = new ActorBindingsAggregatorFactoryWildcardCount({ + name: 'actor', + bus, + factory: expressionEvaluatorFactory, + }); }); describe('test', () => { it('rejects count 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', false), })).rejects.toThrow(); @@ -49,7 +51,6 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { it('rejects count 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', true), })).rejects.toThrow(); @@ -57,7 +58,6 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { it('accepts wildcard count 1', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', false, undefined, true), })).resolves.toEqual({}); @@ -65,7 +65,6 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { it('accepts wildcard count 2', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', true, undefined, true), })).resolves.toEqual({}); @@ -73,7 +72,6 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { it('rejects sum', () => { return expect(actor.test({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('sum', false), })).rejects.toThrow(); @@ -82,7 +80,6 @@ describe('ActorBindingsAggregatorFactoryWildcardCount', () => { it('should run', () => { return expect(actor.run({ - factory: expressionEvaluatorFactory, context: new ActionContext(), expr: makeAggregate('count', false, undefined, true), })).resolves.toMatchObject({ diff --git a/packages/actor-bindings-aggregator-factory-wildcard-count/test/WildcardCountAggregator-test.ts b/packages/actor-bindings-aggregator-factory-wildcard-count/test/WildcardCountAggregator-test.ts index 481ed94956..c847bb70f4 100644 --- a/packages/actor-bindings-aggregator-factory-wildcard-count/test/WildcardCountAggregator-test.ts +++ b/packages/actor-bindings-aggregator-factory-wildcard-count/test/WildcardCountAggregator-test.ts @@ -1,8 +1,8 @@ import type { IBindingsAggregator } from '@comunica/bus-bindings-aggeregator-factory'; +import type { ActorExpressionEvaluatorFactory } from '@comunica/bus-expression-evaluator-factory'; import { ActionContext } from '@comunica/core'; -import { ExpressionEvaluatorFactory } from '@comunica/expression-evaluator'; -import { BF, DF, int, makeAggregate } from '@comunica/jest'; -import type { IActionContext, IExpressionEvaluatorFactory } from '@comunica/types'; +import { BF, DF, getMockEEFactory, int, makeAggregate } from '@comunica/jest'; +import type { IActionContext } from '@comunica/types'; import type * as RDF from '@rdfjs/types'; import { ArrayIterator } from 'asynciterator'; import { WildcardCountAggregator } from '../lib/WildcardCountAggregator'; @@ -15,20 +15,21 @@ async function runAggregator(aggregator: IBindingsAggregator, input: RDF.Binding } async function createAggregator({ expressionEvaluatorFactory, context, distinct }: { - expressionEvaluatorFactory: IExpressionEvaluatorFactory; + expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; context: IActionContext; distinct: boolean; }): Promise { return new WildcardCountAggregator( - await expressionEvaluatorFactory.createEvaluator( - makeAggregate('count', distinct, undefined, true).expression, context, - ), + (await expressionEvaluatorFactory.run({ + algExpr: makeAggregate('count', distinct, undefined, true).expression, + context, + })).expressionEvaluator, distinct, ); } describe('WildcardCountAggregator', () => { - let expressionEvaluatorFactory: IExpressionEvaluatorFactory; + let expressionEvaluatorFactory: ActorExpressionEvaluatorFactory; let context: IActionContext; beforeEach(() => { @@ -45,7 +46,7 @@ describe('WildcardCountAggregator', () => { }), }; - expressionEvaluatorFactory = new ExpressionEvaluatorFactory({ + expressionEvaluatorFactory = getMockEEFactory({ mediatorQueryOperation, mediatorBindingsAggregatorFactory: mediatorQueryOperation, });