Skip to content
This repository was archived by the owner on Nov 22, 2024. It is now read-only.

Commit c506316

Browse files
committed
test: 💍 add test for math.diff
1 parent 451e2b9 commit c506316

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/__tests__/math.spec.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,10 @@ describe("math", () => {
44
it("should define length function", () => {
55
expect(math.len({x: 3, y: 4})).toBe(5);
66
});
7+
it("should define diff function", () => {
8+
expect(math.diff({x: 3, y: 4}, {x: 3, y: 4})).toEqual({x: 0, y: 0});
9+
expect(math.diff({x: 1, y: 4}, {x: 3, y: 4})).toEqual({x: 2, y: 0});
10+
expect(math.diff({x: 3, y: 2}, {x: 3, y: 4})).toEqual({x: 0, y: 2});
11+
expect(math.diff({x: 10, y: 10}, {x: 3, y: 4})).toEqual({x: -7, y: -6});
12+
});
713
});

0 commit comments

Comments
 (0)