Skip to content

Commit 73b2e7f

Browse files
committed
(#85) Updated tests for linear movement
1 parent ffb8e9f commit 73b2e7f

File tree

1 file changed

+4
-14
lines changed

1 file changed

+4
-14
lines changed

Diff for: lib/movementtype.function.spec.ts

+4-14
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,13 @@
11
import { linear } from "./movementtype.function";
22

33
describe("MovementType", () => {
4-
it("should return a set of linear timesteps, one millisecond per step.", () => {
5-
const expected = [1, 1, 1, 1, 1, 1];
4+
it("should return a set of linear timesteps, 1000000 nanosecond per step.", () => {
5+
const expected = [1000000, 1000000, 1000000, 1000000, 1000000, 1000000];
66
expect(linear(6, 1000)).toEqual(expected);
77
});
88

9-
it("should threshold movement speed to one pixel per millisecond in case of faster movement.", () => {
10-
const expected = [1, 1, 1, 1, 1, 1];
11-
expect(linear(6, 2000)).toEqual(expected);
12-
});
13-
14-
it("should should return a set of linear timesteps, two milliseconds per step.", () => {
15-
const expected = [2, 2, 2, 2, 2, 2];
9+
it("should should return a set of linear timesteps, 2000000 nanoseconds per step.", () => {
10+
const expected = [2000000, 2000000, 2000000, 2000000, 2000000, 2000000];
1611
expect(linear(6, 500)).toEqual(expected);
1712
});
18-
19-
it("should floor movement to three milliseconds per step.", () => {
20-
const expected = [3, 3, 3, 3, 3, 3];
21-
expect(linear(6, 300)).toEqual(expected);
22-
});
2313
});

0 commit comments

Comments
 (0)