|
1 |
| -import { MovementType } from "./movementtype.class"; |
| 1 | +import { linear } from "./movementtype.function"; |
2 | 2 |
|
3 | 3 | describe("MovementType", () => {
|
4 | 4 | it("should return a set of linear timesteps, one millisecond per step.", () => {
|
5 | 5 | const expected = [1, 1, 1, 1, 1, 1];
|
6 |
| - expect(MovementType.linear(6, 1000)).toEqual(expected); |
| 6 | + expect(linear(6, 1000)).toEqual(expected); |
7 | 7 | });
|
8 | 8 |
|
9 | 9 | it("should threshold movement speed to one pixel per millisecond in case of faster movement.", () => {
|
10 | 10 | const expected = [1, 1, 1, 1, 1, 1];
|
11 |
| - expect(MovementType.linear(6, 2000)).toEqual(expected); |
| 11 | + expect(linear(6, 2000)).toEqual(expected); |
12 | 12 | });
|
13 | 13 |
|
14 | 14 | it("should should return a set of linear timesteps, two milliseconds per step.", () => {
|
15 | 15 | const expected = [2, 2, 2, 2, 2, 2];
|
16 |
| - expect(MovementType.linear(6, 500)).toEqual(expected); |
| 16 | + expect(linear(6, 500)).toEqual(expected); |
17 | 17 | });
|
18 | 18 |
|
19 | 19 | it("should floor movement to three milliseconds per step.", () => {
|
20 | 20 | const expected = [3, 3, 3, 3, 3, 3];
|
21 |
| - expect(MovementType.linear(6, 300)).toEqual(expected); |
| 21 | + expect(linear(6, 300)).toEqual(expected); |
22 | 22 | });
|
23 | 23 | });
|
0 commit comments