Skip to content

Commit

Permalink
Fix getNextFood tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hallipr committed Aug 2, 2024
1 parent 0c173b0 commit edb7fd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/troughentry.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ describe('TroughEntry', () => {
})

describe('getNextFood', () => {
// getNextFood returns the food type consumed, beginning rate and rate decay
// getNextFood returns the food type consumed, beginning rate, rate decay and pointsPerPiece
it('should select the highest preference food', () => {
const fromTime = DateTime.fromSeconds(0);

const actual = entry.getNextFood(fromTime, ["Raw Meat", "Berry", "Kibble"]);

expect(actual).toEqual({ food: data.food["Berry"], rate: 0.1, decay: -0.00005 })
expect(actual).toMatchObject({ food: data.food["Berry"], rate: 0.1, decay: -0.00005, pointsPerPiece: 20 })
})

it('should use species specific diets', () => {
Expand All @@ -133,7 +133,7 @@ describe('TroughEntry', () => {

const actual = entry.getNextFood(fromTime, ["Raw Meat", "Cooked Meat", "Berry", "Kibble"]);

expect(actual).toEqual({ food: data.food["Raw Meat"], rate: 0.04, decay: -0.00002 })
expect(actual).toMatchObject({ food: data.food["Raw Meat"] })
})
})
})

0 comments on commit edb7fd7

Please sign in to comment.