Skip to content

Commit

Permalink
fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
Greegko committed Feb 24, 2025
1 parent dd9dc15 commit a47bb17
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions games/village-manager/core/tests/activities/battle.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test("should finish correctly", {
battleId: battle({
partyId: party({
id: "random-id",
unitIds: [unit({ dmg: 100, hp: 100 })],
unitIds: [unit({ dmg: 100, hp: 100, armor: 0 })],
}),
defenderPartyId: party({
unitIds: [unit({ dmg: 1, hp: 1, armor: 0 })],
Expand All @@ -47,6 +47,7 @@ test("should gain xp for winner heroes", {
xp: 0,
dmg: 100,
hp: 100,
armor: 0,
level: 1,
type: UnitType.Hero,
}),
Expand All @@ -71,7 +72,7 @@ test("should gain gold", {
battleId: battle({
partyId: party({
id: "party-id",
unitIds: [unit({ dmg: 100, hp: 100 })],
unitIds: [unit({ dmg: 100, hp: 100, armor: 0 })],
stash: { resource: { gold: 0 } },
}),
defenderPartyId: party({
Expand All @@ -93,7 +94,7 @@ test("should gain soul", {
battleId: battle({
partyId: party({
id: "party-id",
unitIds: [unit({ dmg: 100, hp: 100 })],
unitIds: [unit({ dmg: 100, hp: 100, armor: 0 })],
stash: { resource: { soul: 5 } },
}),
defenderPartyId: party({
Expand Down Expand Up @@ -121,6 +122,7 @@ test("should apply item dmg effect", {
unit({
dmg: 10,
hp: 100,
armor: 0,
equipment: {
rightHand: equipmentFactory({
itemType: ItemType.Weapon,
Expand Down Expand Up @@ -156,6 +158,7 @@ test("should apply percentage item dmg effect", {
unit({
dmg: 10,
hp: 100,
armor: 0,
equipment: {
rightHand: equipmentFactory({
itemType: ItemType.Weapon,
Expand Down Expand Up @@ -188,6 +191,8 @@ test("should apply dynamic item effects", {
unit({
dmg: 10,
hp: 100,
armor: 0,
maxhp: 100,
equipment: {
rune: runeFactory({
power: 100,
Expand All @@ -199,7 +204,7 @@ test("should apply dynamic item effects", {
],
}),
defenderPartyId: party({
unitIds: [unit({ id: "defender-unit", dmg: 1, hp: 200, armor: 0, maxhp: 200 })],
unitIds: [unit({ id: "defender-unit", dmg: 1, hp: 200, maxhp: 200, armor: 0 })],
}),
}),
},
Expand Down

0 comments on commit a47bb17

Please sign in to comment.