Skip to content

Commit

Permalink
build: push node version up and refactor test (#2190)
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-okrushko authored and brandonroberts committed Oct 31, 2019
1 parent 0bb23fe commit 025578a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions modules/store/spec/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,21 +57,21 @@ describe(`Store utils`, () => {

describe(`compose()`, () => {
const cube = (n: number) => Math.pow(n, 3);
const precision = (n: number) => parseFloat(n.toPrecision(12));
const addPtTwo = (n: number) => n + 0.2;
const multiplyByFive = (n: number) => n * 5;
const addTwo = (n: number) => n + 2;

it(`should compose functions`, () => {
const addPrecision = compose(
precision,
addPtTwo
const add2AndMultiply5 = compose(
multiplyByFive,
addTwo
);
const addPrecisionCubed = compose(
const add2AndMultiply5Cubed = compose(
cube,
addPrecision
add2AndMultiply5
);

expect(addPrecision(0.1)).toBe(0.3);
expect(addPrecisionCubed(0.1)).toBe(0.027);
expect(add2AndMultiply5(1)).toBe(15);
expect(add2AndMultiply5Cubed(2)).toBe(8000);
});

it(`should act as identity if no functions passed`, () => {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"publish:latest": "ts-node ./build/publish-latest.ts"
},
"engines": {
"node": ">=10.9.0 <=11.12.0",
"node": ">=10.9.0 <=12.12.0",
"npm": ">=5.3.0",
"yarn": ">=1.9.2 <2.0.0"
},
Expand Down

0 comments on commit 025578a

Please sign in to comment.