Skip to content

Instantly share code, notes, and snippets.

@heniotierra
Created June 27, 2019 22:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save heniotierra/b9e4d261dd9a3c12a7617f76bc7f643c to your computer and use it in GitHub Desktop.
Save heniotierra/b9e4d261dd9a3c12a7617f76bc7f643c to your computer and use it in GitHub Desktop.
fdescribe('if currentMonth is passed', () => {
it('testing...', async () => {
const expected = [1, 1.005, 1.009, 1.013, 1.016];
const inputArray = [1,1,1,1,1,1,1,1,1,1,1];
// const summedToInputed2 = 1;
const prodArray = [1,1,1,0.46,1,1,1,0.54,1,1,1];
const thirdArg = 0;
const fourthArg = false;
// [1,1,1,1,1,1,1,1,1,1,1], [1,1,1,0.46,1,1,1,0.54,1,1,1], 0, false
console.log("huh0");
const compiledExpression = await expressionService.compile(
'prodHist(inputArray, prodArray, thirdArg, fourthArg)'
);
console.log("huh2");
const scope = buildCyclicalScope({
inputArray,
prodArray,
thirdArg,
fourthArg,
}, 2);
console.log("expected:", expressionService.evaluateImediate(
compiledExpression,
scope,
));
expect(
expressionService.evaluateImediate(
compiledExpression,
scope,
),
).toEqual(expected);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment