Skip to content

Commit

Permalink
#476 fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Annoraaq committed May 18, 2024
1 parent 017a475 commit 12f852a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
10 changes: 10 additions & 0 deletions src/GridEngine.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,7 @@ describe("GridEngine", () => {
});

it("should follow a char", () => {
const isPosAllowedFn = () => false;
gridEngine.create(createDefaultMockWithLayer(undefined), {
characters: [
{
Expand All @@ -954,6 +955,9 @@ describe("GridEngine", () => {
closestPointIfBlocked: true,
maxPathLength: 10000,
ignoreLayers: true,
isPositionAllowedFn: isPosAllowedFn,
ignoredChars: ["test"],
considerCosts: true,
});

expect(gridEngine.getMovement("player")).toEqual({
Expand All @@ -966,6 +970,9 @@ describe("GridEngine", () => {
maxPathLength: 10000,
ignoreLayers: true,
shortestPathAlgorithm: "BIDIRECTIONAL_SEARCH",
ignoredChars: ["test"],
isPositionAllowedFn: isPosAllowedFn,
considerCosts: true,
},
});
});
Expand Down Expand Up @@ -996,6 +1003,9 @@ describe("GridEngine", () => {
maxPathLength: Infinity,
ignoreLayers: false,
shortestPathAlgorithm: "BIDIRECTIONAL_SEARCH",
ignoredChars: [],
isPositionAllowedFn: expect.anything(),
considerCosts: false,
},
});
});
Expand Down
4 changes: 2 additions & 2 deletions src/GridEngineHeadless.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ describe("GridEngineHeadless", () => {

expect(gridEngineHeadless.getMovement("player")).toEqual({
type: "Follow",
config: expect.objectContaining({
config: {
charToFollow: "player2",
distance: 0,
noPathFoundStrategy: NoPathFoundStrategy.STOP,
Expand All @@ -839,7 +839,7 @@ describe("GridEngineHeadless", () => {
ignoredChars: [],
isPositionAllowedFn: expect.anything(),
considerCosts: false,
}),
},
});
});

Expand Down

0 comments on commit 12f852a

Please sign in to comment.