diff --git a/.run/Devoted Servant Role.run.xml b/.run/Devoted Servant Role.run.xml
new file mode 100644
index 000000000..c5b4419cf
--- /dev/null
+++ b/.run/Devoted Servant Role.run.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/README.md b/README.md
index a52cdb355..2f9f2fc53 100644
--- a/README.md
+++ b/README.md
@@ -49,17 +49,17 @@ This is the **next** version of the current **[Werewolves Assistant API](https:/
## 🃏 Available roles
-**29 different official roles** are available to play :
-
-|
**Werewolf** |
**Big Bad Wolf** |
**Accursed Wolf-Father** |
**White Werewolf** |
-|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
-|
**Villager** |
**Villager-Villager** |
**Seer** |
**Cupid** |
-|
**Witch** |
**Hunter** |
**Little Girl** |
**Defender** |
-|
**Elder** |
**Scapegoat** |
**Idiot** |
**Two Sisters** |
-|
**Three Brothers** |
**Fox** |
**Bear Tamer** |
**Stuttering Judge** |
-|
**Rusty Sword Knight** |
**Wild Child** |
**Wolf-Hound** |
**Thief** |
-|
**Angel** |
**Pied Piper** |
**Scandalmonger** |
**Prejudiced Manipulator** |
-|
**Actor** | | | |
+**30 different official roles** are available to play :
+
+|
**Werewolf** |
**Big Bad Wolf** |
**Accursed Wolf-Father** |
**White Werewolf** |
+|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
+|
**Villager** |
**Villager-Villager** |
**Seer** |
**Cupid** |
+|
**Witch** |
**Hunter** |
**Little Girl** |
**Defender** |
+|
**Elder** |
**Scapegoat** |
**Idiot** |
**Two Sisters** |
+|
**Three Brothers** |
**Fox** |
**Bear Tamer** |
**Stuttering Judge** |
+|
**Rusty Sword Knight** |
**Wild Child** |
**Wolf-Hound** |
**Thief** |
+|
**Angel** |
**Pied Piper** |
**Scandalmonger** |
**Prejudiced Manipulator** |
+|
**Actor** |
**Devoted Servant** | | |
## 🔨 Installation
diff --git a/public/assets/images/roles/devoted-servant/devoted-servant-small.jpeg b/public/assets/images/roles/devoted-servant/devoted-servant-small.jpeg
new file mode 100644
index 000000000..8669aad38
Binary files /dev/null and b/public/assets/images/roles/devoted-servant/devoted-servant-small.jpeg differ
diff --git a/public/assets/images/roles/devoted-servant/devoted-servant.jpeg b/public/assets/images/roles/devoted-servant/devoted-servant.jpeg
new file mode 100644
index 000000000..4d3bbdf54
Binary files /dev/null and b/public/assets/images/roles/devoted-servant/devoted-servant.jpeg differ
diff --git a/src/modules/game/constants/game-play/game-play.constant.ts b/src/modules/game/constants/game-play/game-play.constant.ts
index 66f109f4d..4e0233eeb 100644
--- a/src/modules/game/constants/game-play/game-play.constant.ts
+++ b/src/modules/game/constants/game-play/game-play.constant.ts
@@ -41,6 +41,7 @@ const TARGET_ACTIONS = [
GamePlayActions.MARK,
GamePlayActions.SNIFF,
GamePlayActions.BAN_VOTING,
+ GamePlayActions.BURY_DEAD_BODIES,
] as const satisfies Readonly;
const VOTE_ACTIONS = [
diff --git a/src/modules/game/enums/player.enum.ts b/src/modules/game/enums/player.enum.ts
index f994d35ae..1ebd63b39 100644
--- a/src/modules/game/enums/player.enum.ts
+++ b/src/modules/game/enums/player.enum.ts
@@ -21,6 +21,8 @@ enum PlayerAttributeNames {
CHARMED = "charmed",
GROWLED = "growled",
CONTAMINATED = "contaminated",
+ STOLEN_ROLE = "stolen-role",
+ ACTING = "acting",
}
enum PlayerDeathCauses {
@@ -50,6 +52,7 @@ enum PlayerInteractionTypes {
BAN_VOTING = "ban-voting",
TRANSFER_SHERIFF_ROLE = "transfer-sheriff-role",
SENTENCE_TO_DEATH = "sentence-to-death",
+ STEAL_ROLE = "steal-role",
}
export {
diff --git a/src/modules/game/game.module.ts b/src/modules/game/game.module.ts
index 3d43039f7..22741f47b 100644
--- a/src/modules/game/game.module.ts
+++ b/src/modules/game/game.module.ts
@@ -1,6 +1,7 @@
import { Module } from "@nestjs/common";
import { MongooseModule } from "@nestjs/mongoose";
+import { DevotedServantGamePlayMakerService } from "@/modules/game/providers/services/game-play/game-play-maker/devoted-servant-game-play-maker.service";
import { GamePlayAugmenterService } from "@/modules/game/providers/services/game-play/game-play-augmenter.service";
import { GameVictoryService } from "@/modules/game/providers/services/game-victory/game-victory.service";
import { DatabaseModule } from "@/modules/config/database/database.module";
@@ -9,7 +10,7 @@ import { GameHistoryRecordRepository } from "@/modules/game/providers/repositori
import { GameRepository } from "@/modules/game/providers/repositories/game.repository";
import { GameHistoryRecordService } from "@/modules/game/providers/services/game-history/game-history-record.service";
import { GamePhaseService } from "@/modules/game/providers/services/game-phase/game-phase.service";
-import { GamePlayMakerService } from "@/modules/game/providers/services/game-play/game-play-maker.service";
+import { GamePlayMakerService } from "@/modules/game/providers/services/game-play/game-play-maker/game-play-maker.service";
import { GamePlayValidatorService } from "@/modules/game/providers/services/game-play/game-play-validator.service";
import { GamePlayVoteService } from "@/modules/game/providers/services/game-play/game-play-vote/game-play-vote.service";
import { GamePlayService } from "@/modules/game/providers/services/game-play/game-play.service";
@@ -35,6 +36,7 @@ import { Game, GAME_SCHEMA } from "@/modules/game/schemas/game.schema";
GamePlayService,
GamePlayValidatorService,
GamePlayMakerService,
+ DevotedServantGamePlayMakerService,
GamePlayVoteService,
GamePlayAugmenterService,
GamePhaseService,
diff --git a/src/modules/game/helpers/game.helper.ts b/src/modules/game/helpers/game.helper.ts
index 60c9a4586..f8442c9a3 100644
--- a/src/modules/game/helpers/game.helper.ts
+++ b/src/modules/game/helpers/game.helper.ts
@@ -11,7 +11,7 @@ import type { Player } from "@/modules/game/schemas/player/player.schema";
import type { GameSource, GetNearestPlayerOptions } from "@/modules/game/types/game.type";
import { RoleNames, RoleSides } from "@/modules/role/enums/role.enum";
-import { createCantFindPlayerUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+import { createCantFindPlayerWithIdUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
function getPlayerDtoWithRole(game: CreateGameDto, role: RoleNames): CreateGamePlayerDto | undefined {
return game.players.find(player => player.role.name === role);
@@ -41,6 +41,10 @@ function getPlayerWithIdOrThrow(playerId: Types.ObjectId, game: Game, exception:
return player;
}
+function getPlayersWithIds(ids: Types.ObjectId[], game: Game): Player[] {
+ return game.players.filter(({ _id }) => ids.some(id => id.equals(_id)));
+}
+
function getPlayerWithName(game: Game, playerName: string): Player | undefined {
return game.players.find(({ name }) => name === playerName);
}
@@ -138,7 +142,7 @@ function getNonexistentPlayer(game: Game, candidatePlayers?: Player[]): Player |
}
function getFoxSniffedPlayers(sniffedTargetId: Types.ObjectId, game: Game): Player[] {
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("getFoxSniffedTargets", { gameId: game._id, playerId: sniffedTargetId });
+ const cantFindPlayerException = createCantFindPlayerWithIdUnexpectedException("getFoxSniffedTargets", { gameId: game._id, playerId: sniffedTargetId });
const sniffedTarget = getPlayerWithIdOrThrow(sniffedTargetId, game, cantFindPlayerException);
const leftAliveNeighbor = getNearestAliveNeighbor(sniffedTarget._id, game, { direction: "left" });
const rightAliveNeighbor = getNearestAliveNeighbor(sniffedTarget._id, game, { direction: "right" });
@@ -172,7 +176,7 @@ function getNearestAliveNeighborInSortedPlayers(seekingNeighborPlayer: Player, s
}
function getNearestAliveNeighbor(playerId: Types.ObjectId, game: Game, options: GetNearestPlayerOptions): Player | undefined {
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("getNearestAliveNeighbor", { gameId: game._id, playerId });
+ const cantFindPlayerException = createCantFindPlayerWithIdUnexpectedException("getNearestAliveNeighbor", { gameId: game._id, playerId });
const player = getPlayerWithIdOrThrow(playerId, game, cantFindPlayerException);
const sortedPlayers = game.players.toSorted((a, b) => a.position - b.position);
return getNearestAliveNeighborInSortedPlayers(player, sortedPlayers, options);
@@ -182,6 +186,11 @@ function getAllowedToVotePlayers(game: Game): Player[] {
return game.players.filter(player => player.isAlive && !doesPlayerHaveActiveAttributeWithName(player, PlayerAttributeNames.CANT_VOTE, game));
}
+function doesGameHaveUpcomingPlaySourceAndAction(game: Game, source: GameSource, action: GamePlayActions): boolean {
+ const { upcomingPlays } = game;
+ return upcomingPlays.some(play => play.source.name === source && play.action === action);
+}
+
function doesGameHaveCurrentOrUpcomingPlaySourceAndAction(game: Game, source: GameSource, action: GamePlayActions): boolean {
const { currentPlay, upcomingPlays } = game;
const gamePlays = currentPlay ? [currentPlay, ...upcomingPlays] : upcomingPlays;
@@ -195,6 +204,7 @@ export {
getPlayersWithCurrentSide,
getPlayerWithId,
getPlayerWithIdOrThrow,
+ getPlayersWithIds,
getPlayerWithName,
getPlayerWithNameOrThrow,
getAdditionalCardWithId,
@@ -217,5 +227,6 @@ export {
getFoxSniffedPlayers,
getNearestAliveNeighbor,
getAllowedToVotePlayers,
+ doesGameHaveUpcomingPlaySourceAndAction,
doesGameHaveCurrentOrUpcomingPlaySourceAndAction,
};
\ No newline at end of file
diff --git a/src/modules/game/helpers/game.mutator.ts b/src/modules/game/helpers/game.mutator.ts
index 4b45d0851..f837e67e0 100644
--- a/src/modules/game/helpers/game.mutator.ts
+++ b/src/modules/game/helpers/game.mutator.ts
@@ -1,5 +1,6 @@
import type { Types } from "mongoose";
+import type { GameSource } from "@/modules/game/types/game.type";
import { createGameAdditionalCard } from "@/modules/game/helpers/game-additional-card/game-additional-card.factory";
import type { GameAdditionalCard } from "@/modules/game/schemas/game-additional-card/game-additional-card.schema";
import type { PlayerAttributeNames } from "@/modules/game/enums/player.enum";
@@ -53,6 +54,16 @@ function removePlayerAttributeByNameInGame(playerId: Types.ObjectId, game: Game,
return updatePlayerInGame(playerId, player, clonedGame);
}
+function removePlayerAttributeByNameAndSourceInGame(playerId: Types.ObjectId, game: Game, attributeName: PlayerAttributeNames, attributeSource: GameSource): Game {
+ const clonedGame = createGame(game);
+ const player = getPlayerWithId(clonedGame, playerId);
+ if (!player) {
+ return clonedGame;
+ }
+ player.attributes = player.attributes.filter(({ name, source }) => name !== attributeName || source !== attributeSource);
+ return updatePlayerInGame(playerId, player, clonedGame);
+}
+
function prependUpcomingPlayInGame(gamePlay: GamePlay, game: Game): Game {
const clonedGame = createGame(game);
clonedGame.upcomingPlays.unshift(gamePlay);
@@ -83,6 +94,7 @@ export {
addPlayerAttributeInGame,
addPlayersAttributeInGame,
removePlayerAttributeByNameInGame,
+ removePlayerAttributeByNameAndSourceInGame,
prependUpcomingPlayInGame,
appendUpcomingPlayInGame,
updateAdditionalCardInGame,
diff --git a/src/modules/game/helpers/player/player-attribute/player-attribute.factory.ts b/src/modules/game/helpers/player/player-attribute/player-attribute.factory.ts
index 3a488640a..de87f7e4b 100644
--- a/src/modules/game/helpers/player/player-attribute/player-attribute.factory.ts
+++ b/src/modules/game/helpers/player/player-attribute/player-attribute.factory.ts
@@ -9,6 +9,23 @@ import { RoleNames } from "@/modules/role/enums/role.enum";
import { toJSON } from "@/shared/misc/helpers/object.helper";
import { DEFAULT_PLAIN_TO_INSTANCE_OPTIONS } from "@/shared/validation/constants/validation.constant";
+function createActingByActorPlayerAttribute(playerAttribute: Partial = {}): PlayerAttribute {
+ return createPlayerAttribute({
+ name: PlayerAttributeNames.ACTING,
+ source: RoleNames.ACTOR,
+ ...playerAttribute,
+ });
+}
+
+function createStolenRoleByDevotedServantPlayerAttribute(playerAttribute: Partial = {}): PlayerAttribute {
+ return createPlayerAttribute({
+ name: PlayerAttributeNames.STOLEN_ROLE,
+ source: RoleNames.DEVOTED_SERVANT,
+ doesRemainAfterDeath: true,
+ ...playerAttribute,
+ });
+}
+
function createContaminatedByRustySwordKnightPlayerAttribute(playerAttribute: Partial = {}): PlayerAttribute {
return createPlayerAttribute({
name: PlayerAttributeNames.CONTAMINATED,
@@ -212,6 +229,8 @@ function createPlayerAttribute(playerAttribute: PlayerAttribute): PlayerAttribut
}
export {
+ createActingByActorPlayerAttribute,
+ createStolenRoleByDevotedServantPlayerAttribute,
createContaminatedByRustySwordKnightPlayerAttribute,
createGrowledByBearTamerPlayerAttribute,
createCharmedByPiedPiperPlayerAttribute,
diff --git a/src/modules/game/helpers/player/player-attribute/player-attribute.helper.ts b/src/modules/game/helpers/player/player-attribute/player-attribute.helper.ts
index 5dfd6a936..b3877ca72 100644
--- a/src/modules/game/helpers/player/player-attribute/player-attribute.helper.ts
+++ b/src/modules/game/helpers/player/player-attribute/player-attribute.helper.ts
@@ -1,9 +1,11 @@
import { GamePhases } from "@/modules/game/enums/game.enum";
-import type { PlayerAttributeNames } from "@/modules/game/enums/player.enum";
+import { PlayerAttributeNames } from "@/modules/game/enums/player.enum";
+import { isPlayerPowerful } from "@/modules/game/helpers/player/player.helper";
import type { Game } from "@/modules/game/schemas/game.schema";
import type { PlayerAttribute } from "@/modules/game/schemas/player/player-attribute/player-attribute.schema";
import type { Player } from "@/modules/game/schemas/player/player.schema";
import type { GameSource } from "@/modules/game/types/game.type";
+import { RoleNames } from "@/modules/role/enums/role.enum";
function isPlayerAttributeActive({ activeAt }: PlayerAttribute, game: Game): boolean {
return activeAt === undefined || activeAt.turn < game.turn ||
@@ -39,6 +41,10 @@ function doesPlayerHaveActiveAttributeWithNameAndSource(player: Player, attribut
return !!attribute && isPlayerAttributeActive(attribute, game);
}
+function canPlayerDelegateSheriffAttribute(player: Player, game: Game): boolean {
+ return doesPlayerHaveActiveAttributeWithName(player, PlayerAttributeNames.SHERIFF, game) && (player.role.current !== RoleNames.IDIOT || !isPlayerPowerful(player, game));
+}
+
export {
isPlayerAttributeActive,
getPlayerAttributeWithName,
@@ -48,4 +54,5 @@ export {
getPlayerAttributeWithNameAndSource,
doesPlayerHaveAttributeWithNameAndSource,
doesPlayerHaveActiveAttributeWithNameAndSource,
+ canPlayerDelegateSheriffAttribute,
};
\ No newline at end of file
diff --git a/src/modules/game/helpers/player/player.factory.ts b/src/modules/game/helpers/player/player.factory.ts
index 9f177fa0b..5ab495c74 100644
--- a/src/modules/game/helpers/player/player.factory.ts
+++ b/src/modules/game/helpers/player/player.factory.ts
@@ -1,5 +1,6 @@
import { plainToInstance } from "class-transformer";
+import { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
import { Player } from "@/modules/game/schemas/player/player.schema";
import { toJSON } from "@/shared/misc/helpers/object.helper";
@@ -9,4 +10,11 @@ function createPlayer(player: Player): Player {
return plainToInstance(Player, toJSON(player), { ...DEFAULT_PLAIN_TO_INSTANCE_OPTIONS, excludeExtraneousValues: true });
}
-export { createPlayer };
\ No newline at end of file
+function createDeadPlayer(deadPlayer: DeadPlayer): DeadPlayer {
+ return plainToInstance(DeadPlayer, toJSON(deadPlayer), { ...DEFAULT_PLAIN_TO_INSTANCE_OPTIONS, excludeExtraneousValues: true });
+}
+
+export {
+ createPlayer,
+ createDeadPlayer,
+};
\ No newline at end of file
diff --git a/src/modules/game/providers/repositories/game-history-record.repository.ts b/src/modules/game/providers/repositories/game-history-record.repository.ts
index 7782392ae..7903500f0 100644
--- a/src/modules/game/providers/repositories/game-history-record.repository.ts
+++ b/src/modules/game/providers/repositories/game-history-record.repository.ts
@@ -3,6 +3,7 @@ import { InjectModel } from "@nestjs/mongoose";
import { Model } from "mongoose";
import type { FilterQuery, Types, QueryOptions } from "mongoose";
+import type { Player } from "@/modules/game/schemas/player/player.schema";
import type { GamePlay } from "@/modules/game/schemas/game-play/game-play.schema";
import { convertGetGameHistoryDtoToMongooseQueryOptions } from "@/modules/game/helpers/game-history/game-history-record.mapper";
import type { GetGameHistoryDto } from "@/modules/game/dto/get-game-history/get-game-history.dto";
@@ -26,11 +27,12 @@ export class GameHistoryRecordRepository {
return this.gameHistoryRecordModel.create(gameHistoryRecord);
}
- public async getLastGameHistoryDefenderProtectsRecord(gameId: Types.ObjectId): Promise {
+ public async getLastGameHistoryDefenderProtectsRecord(gameId: Types.ObjectId, defenderPlayerId: Types.ObjectId): Promise {
const filter: FilterQuery = {
gameId,
"play.action": GamePlayActions.PROTECT,
"play.source.name": RoleNames.DEFENDER,
+ "play.source.players": { $elemMatch: { _id: defenderPlayerId } },
};
return this.gameHistoryRecordModel.findOne(filter, undefined, { sort: { createdAt: -1 } });
}
@@ -44,28 +46,41 @@ export class GameHistoryRecordRepository {
return this.gameHistoryRecordModel.findOne(filter, undefined, { sort: { createdAt: -1 } });
}
- public async getGameHistoryWitchUsesSpecificPotionRecords(gameId: Types.ObjectId, potion: WitchPotions): Promise {
+ public async getGameHistoryWitchUsesSpecificPotionRecords(gameId: Types.ObjectId, witchPlayerId: Types.ObjectId, potion: WitchPotions): Promise {
const filter: FilterQuery = {
gameId,
- "play.source.name": RoleNames.WITCH,
"play.action": GamePlayActions.USE_POTIONS,
+ "play.source.name": RoleNames.WITCH,
+ "play.source.players": { $elemMatch: { _id: witchPlayerId } },
"play.targets.drankPotion": potion,
};
return this.gameHistoryRecordModel.find(filter);
}
- public async getGameHistoryAccursedWolfFatherInfectedRecords(gameId: Types.ObjectId): Promise {
+ public async getGameHistoryAccursedWolfFatherInfectedRecords(gameId: Types.ObjectId, accursedWolfFatherPlayerId: Types.ObjectId): Promise {
const filter: FilterQuery = {
gameId,
"play.action": GamePlayActions.EAT,
"play.targets.isInfected": true,
+ "play.source.players": {
+ $elemMatch: {
+ "_id": accursedWolfFatherPlayerId,
+ "role.current": RoleNames.ACCURSED_WOLF_FATHER,
+ },
+ },
};
return this.gameHistoryRecordModel.find(filter);
}
- public async getGameHistoryJudgeRequestRecords(gameId: Types.ObjectId): Promise {
+ public async getGameHistoryJudgeRequestRecords(gameId: Types.ObjectId, stutteringJudgePlayerId: Types.ObjectId): Promise {
const filter: FilterQuery = {
gameId,
+ "play.source.players": {
+ $elemMatch: {
+ "_id": stutteringJudgePlayerId,
+ "role.current": RoleNames.STUTTERING_JUDGE,
+ },
+ },
"play.didJudgeRequestAnotherVote": true,
};
return this.gameHistoryRecordModel.find(filter);
@@ -80,29 +95,40 @@ export class GameHistoryRecordRepository {
return this.gameHistoryRecordModel.find(filter);
}
- public async getGameHistoryWerewolvesEatElderRecords(gameId: Types.ObjectId): Promise {
+ public async getGameHistoryWerewolvesEatElderRecords(gameId: Types.ObjectId, elderPlayerId: Types.ObjectId): Promise {
const filter: FilterQuery = {
gameId,
"play.action": GamePlayActions.EAT,
- "play.targets.player.role.current": RoleNames.ELDER,
+ "play.targets": {
+ $elemMatch: {
+ "player._id": elderPlayerId,
+ "player.role.current": RoleNames.ELDER,
+ },
+ },
};
return this.gameHistoryRecordModel.find(filter);
}
- public async getGameHistoryElderProtectedFromWerewolvesRecords(gameId: Types.ObjectId): Promise {
+ public async getGameHistoryElderProtectedFromWerewolvesRecords(gameId: Types.ObjectId, elderPlayerId: Types.ObjectId): Promise {
const filter: FilterQuery = {
gameId,
$or: [
{
"play.source.name": RoleNames.DEFENDER,
"play.action": GamePlayActions.PROTECT,
- "play.targets.player.role.current": RoleNames.ELDER,
+ "play.targets": {
+ $elemMatch: {
+ "player._id": elderPlayerId,
+ "player.role.current": RoleNames.ELDER,
+ },
+ },
},
{
"play.source.name": RoleNames.WITCH,
"play.action": GamePlayActions.USE_POTIONS,
"play.targets": {
$elemMatch: {
+ "player._id": elderPlayerId,
"player.role.current": RoleNames.ELDER,
"drankPotion": WitchPotions.LIFE,
},
@@ -131,4 +157,20 @@ export class GameHistoryRecordRepository {
};
return this.gameHistoryRecordModel.find(filter, undefined, options);
}
+
+ public async getGameHistoryGamePlayMadeByPlayerRecords(
+ gameId: Types.ObjectId,
+ gamePlay: GamePlay,
+ player: Player,
+ options: QueryOptions = {},
+ ): Promise {
+ const filter: FilterQuery = {
+ gameId,
+ "play.action": gamePlay.action,
+ "play.source.name": gamePlay.source.name,
+ "play.source.players": { $elemMatch: { _id: player._id } },
+ "play.cause": gamePlay.cause,
+ };
+ return this.gameHistoryRecordModel.find(filter, undefined, options);
+ }
}
\ No newline at end of file
diff --git a/src/modules/game/providers/services/game-history/game-history-record.service.ts b/src/modules/game/providers/services/game-history/game-history-record.service.ts
index 03d8f9305..c32eae17c 100644
--- a/src/modules/game/providers/services/game-history/game-history-record.service.ts
+++ b/src/modules/game/providers/services/game-history/game-history-record.service.ts
@@ -2,6 +2,7 @@ import { Injectable } from "@nestjs/common";
import { plainToInstance } from "class-transformer";
import type { Types } from "mongoose";
+import type { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
import type { GamePlay } from "@/modules/game/schemas/game-play/game-play.schema";
import type { GetGameHistoryDto } from "@/modules/game/dto/get-game-history/get-game-history.dto";
import type { MakeGamePlayWithRelationsDto } from "@/modules/game/dto/make-game-play/make-game-play-with-relations.dto";
@@ -43,24 +44,24 @@ export class GameHistoryRecordService {
return this.gameHistoryRecordRepository.create(gameHistoryRecordToInsert);
}
- public async getLastGameHistoryDefenderProtectsRecord(gameId: Types.ObjectId): Promise {
- return this.gameHistoryRecordRepository.getLastGameHistoryDefenderProtectsRecord(gameId);
+ public async getLastGameHistoryDefenderProtectsRecord(gameId: Types.ObjectId, defenderPlayerId: Types.ObjectId): Promise {
+ return this.gameHistoryRecordRepository.getLastGameHistoryDefenderProtectsRecord(gameId, defenderPlayerId);
}
public async getLastGameHistoryTieInVotesRecord(gameId: Types.ObjectId, action: GamePlayActions): Promise {
return this.gameHistoryRecordRepository.getLastGameHistoryTieInVotesRecord(gameId, action);
}
- public async getGameHistoryWitchUsesSpecificPotionRecords(gameId: Types.ObjectId, potion: WitchPotions): Promise {
- return this.gameHistoryRecordRepository.getGameHistoryWitchUsesSpecificPotionRecords(gameId, potion);
+ public async getGameHistoryWitchUsesSpecificPotionRecords(gameId: Types.ObjectId, witchPlayerId: Types.ObjectId, potion: WitchPotions): Promise {
+ return this.gameHistoryRecordRepository.getGameHistoryWitchUsesSpecificPotionRecords(gameId, witchPlayerId, potion);
}
- public async getGameHistoryAccursedWolfFatherInfectedRecords(gameId: Types.ObjectId): Promise {
- return this.gameHistoryRecordRepository.getGameHistoryAccursedWolfFatherInfectedRecords(gameId);
+ public async getGameHistoryAccursedWolfFatherInfectedRecords(gameId: Types.ObjectId, accursedWolfFatherPlayer: Types.ObjectId): Promise {
+ return this.gameHistoryRecordRepository.getGameHistoryAccursedWolfFatherInfectedRecords(gameId, accursedWolfFatherPlayer);
}
- public async getGameHistoryJudgeRequestRecords(gameId: Types.ObjectId): Promise {
- return this.gameHistoryRecordRepository.getGameHistoryJudgeRequestRecords(gameId);
+ public async getGameHistoryJudgeRequestRecords(gameId: Types.ObjectId, stutteringJudgePlayedId: Types.ObjectId): Promise {
+ return this.gameHistoryRecordRepository.getGameHistoryJudgeRequestRecords(gameId, stutteringJudgePlayedId);
}
public async didJudgeMakeHisSign(gameId: Types.ObjectId): Promise {
@@ -68,12 +69,12 @@ export class GameHistoryRecordService {
return records.length > 0;
}
- public async getGameHistoryWerewolvesEatElderRecords(gameId: Types.ObjectId): Promise {
- return this.gameHistoryRecordRepository.getGameHistoryWerewolvesEatElderRecords(gameId);
+ public async getGameHistoryWerewolvesEatElderRecords(gameId: Types.ObjectId, elderPlayerId: Types.ObjectId): Promise {
+ return this.gameHistoryRecordRepository.getGameHistoryWerewolvesEatElderRecords(gameId, elderPlayerId);
}
- public async getGameHistoryElderProtectedFromWerewolvesRecords(gameId: Types.ObjectId): Promise {
- return this.gameHistoryRecordRepository.getGameHistoryElderProtectedFromWerewolvesRecords(gameId);
+ public async getGameHistoryElderProtectedFromWerewolvesRecords(gameId: Types.ObjectId, elderPlayerId: Types.ObjectId): Promise {
+ return this.gameHistoryRecordRepository.getGameHistoryElderProtectedFromWerewolvesRecords(gameId, elderPlayerId);
}
public async getGameHistoryPhaseRecords(gameId: Types.ObjectId, turn: number, phase: GamePhases): Promise {
@@ -105,17 +106,22 @@ export class GameHistoryRecordService {
return this.gameHistoryRecordRepository.getGameHistory(gameId, getGameHistoryDto);
}
- public async hasGamePlayBeenMade(gameId: Types.ObjectId, play: GamePlay): Promise {
- const records = await this.gameHistoryRecordRepository.getGameHistoryGamePlayRecords(gameId, play, { limit: 1 });
+ public async hasGamePlayBeenMade(gameId: Types.ObjectId, gamePlay: GamePlay): Promise {
+ const records = await this.gameHistoryRecordRepository.getGameHistoryGamePlayRecords(gameId, gamePlay, { limit: 1 });
return records.length > 0;
}
- private generateCurrentGameHistoryRecordDeadPlayersToInsert(baseGame: Game, newGame: Game): Player[] | undefined {
+ public async hasGamePlayBeenMadeByPlayer(gameId: Types.ObjectId, gamePlay: GamePlay, player: Player): Promise {
+ const records = await this.gameHistoryRecordRepository.getGameHistoryGamePlayMadeByPlayerRecords(gameId, gamePlay, player, { limit: 1 });
+ return records.length > 0;
+ }
+
+ private generateCurrentGameHistoryRecordDeadPlayersToInsert(baseGame: Game, newGame: Game): DeadPlayer[] | undefined {
const { players: newPlayers } = newGame;
const currentDeadPlayers = newPlayers.filter(player => {
const matchingBasePlayer = getPlayerWithId(baseGame, player._id);
return matchingBasePlayer?.isAlive === true && !player.isAlive;
- });
+ }) as DeadPlayer[];
return currentDeadPlayers.length ? currentDeadPlayers : undefined;
}
@@ -151,7 +157,7 @@ export class GameHistoryRecordService {
const sheriffPlayer = getPlayerWithActiveAttributeName(newGame, PlayerAttributeNames.SHERIFF);
const areSomePlayersDeadFromCurrentVotes = gameHistoryRecordToInsert.deadPlayers?.some(({ death }) => {
const deathFromVoteCauses = [PlayerDeathCauses.VOTE, PlayerDeathCauses.VOTE_SCAPEGOATED];
- return death?.cause !== undefined && deathFromVoteCauses.includes(death.cause);
+ return deathFromVoteCauses.includes(death.cause);
}) === true;
if (baseGame.currentPlay.action === GamePlayActions.ELECT_SHERIFF) {
return sheriffPlayer ? GameHistoryRecordVotingResults.SHERIFF_ELECTION : GameHistoryRecordVotingResults.TIE;
diff --git a/src/modules/game/providers/services/game-phase/game-phase.service.ts b/src/modules/game/providers/services/game-phase/game-phase.service.ts
index c5525c37d..4806cac59 100644
--- a/src/modules/game/providers/services/game-phase/game-phase.service.ts
+++ b/src/modules/game/providers/services/game-phase/game-phase.service.ts
@@ -1,6 +1,5 @@
import { Injectable } from "@nestjs/common";
-import type { GameSource } from "@/modules/game/types/game.type";
import { GamePhases } from "@/modules/game/enums/game.enum";
import { PlayerAttributeNames } from "@/modules/game/enums/player.enum";
import { createGame } from "@/modules/game/helpers/game.factory";
@@ -14,9 +13,10 @@ import { GamePlayService } from "@/modules/game/providers/services/game-play/gam
import { PlayerAttributeService } from "@/modules/game/providers/services/player/player-attribute.service";
import type { Game } from "@/modules/game/schemas/game.schema";
import type { Player } from "@/modules/game/schemas/player/player.schema";
+import type { GameSource } from "@/modules/game/types/game.type";
import { RoleNames, RoleSides } from "@/modules/role/enums/role.enum";
-import { createCantFindPlayerUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+import { createCantFindPlayerWithIdUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
@Injectable()
export class GamePhaseService {
@@ -49,7 +49,7 @@ export class GamePhaseService {
if (clonedGame.phase === GamePhases.DAY) {
return this.applyStartingDayPlayerRoleOutcomesToPlayers(clonedGame);
}
- return this.applyStartingNightPlayerRoleOutcomes(clonedGame);
+ return this.applyStartingNightPlayerAttributesOutcomes(clonedGame);
}
private async applyEndingGamePhasePlayerAttributesOutcomesToPlayers(game: Game): Promise {
@@ -74,7 +74,7 @@ export class GamePhaseService {
let clonedPlayer = createPlayer(player);
const eatenAttribute = getActivePlayerAttributeWithName(clonedPlayer, PlayerAttributeNames.EATEN, clonedGame);
const notFoundPlayerExceptionInterpolations = { gameId: clonedGame._id, playerId: clonedPlayer._id };
- const notFoundPlayerException = createCantFindPlayerUnexpectedException("applyEndingNightPlayerAttributesOutcomesToPlayer", notFoundPlayerExceptionInterpolations);
+ const notFoundPlayerException = createCantFindPlayerWithIdUnexpectedException("applyEndingNightPlayerAttributesOutcomesToPlayer", notFoundPlayerExceptionInterpolations);
if (eatenAttribute) {
clonedGame = await this.playerAttributeService.applyEatenAttributeOutcomes(clonedPlayer, clonedGame, eatenAttribute);
}
@@ -118,19 +118,21 @@ export class GamePhaseService {
return clonedGame;
}
- private applyStartingNightActorRoleOutcomes(actorPlayer: Player, game: Game): Game {
+ private applyStartingNightActingPlayerOutcomes(actingPlayer: Player, game: Game): Game {
const clonedGame = createGame(game);
const stickyPowerlessSources: GameSource[] = [RoleNames.ACCURSED_WOLF_FATHER, RoleNames.ACTOR];
- const attributes = actorPlayer.attributes.filter(({ name, source }) => name !== PlayerAttributeNames.POWERLESS || stickyPowerlessSources.includes(source));
- const playerDataToUpdate: Partial = { role: { ...actorPlayer.role, current: RoleNames.ACTOR, isRevealed: false }, attributes };
- return updatePlayerInGame(actorPlayer._id, playerDataToUpdate, clonedGame);
+ const attributes = actingPlayer.attributes.filter(({ name, source }) =>
+ name !== PlayerAttributeNames.ACTING && name !== PlayerAttributeNames.POWERLESS ||
+ name === PlayerAttributeNames.POWERLESS && stickyPowerlessSources.includes(source));
+ const playerDataToUpdate: Partial = { role: { ...actingPlayer.role, current: RoleNames.ACTOR, isRevealed: false }, attributes };
+ return updatePlayerInGame(actingPlayer._id, playerDataToUpdate, clonedGame);
}
- private applyStartingNightPlayerRoleOutcomes(game: Game): Game {
+ private applyStartingNightPlayerAttributesOutcomes(game: Game): Game {
let clonedGame = createGame(game);
for (const player of clonedGame.players) {
- if (player.role.original === RoleNames.ACTOR && player.isAlive) {
- clonedGame = this.applyStartingNightActorRoleOutcomes(player, clonedGame);
+ if (doesPlayerHaveActiveAttributeWithName(player, PlayerAttributeNames.ACTING, clonedGame)) {
+ clonedGame = this.applyStartingNightActingPlayerOutcomes(player, clonedGame);
}
}
return clonedGame;
diff --git a/src/modules/game/providers/services/game-play/game-play-augmenter.service.ts b/src/modules/game/providers/services/game-play/game-play-augmenter.service.ts
index 920f0ff14..964fd786b 100644
--- a/src/modules/game/providers/services/game-play/game-play-augmenter.service.ts
+++ b/src/modules/game/providers/services/game-play/game-play-augmenter.service.ts
@@ -1,16 +1,16 @@
import { Injectable } from "@nestjs/common";
import { VOTE_ACTIONS } from "@/modules/game/constants/game-play/game-play.constant";
-import { createPlayer } from "@/modules/game/helpers/player/player.factory";
-import type { Player } from "@/modules/game/schemas/player/player.schema";
-import { createGamePlayEligibleTargetsBoundaries } from "@/modules/game/helpers/game-play/game-play-eligible-targets/game-play-eligible-targets-boundaries/game-play-eligible-targets-boundaries.factory";
-import { createInteractablePlayer } from "@/modules/game/helpers/game-play/game-play-eligible-targets/interactable-player/interactable-player.factory";
-import { doesPlayerHaveActiveAttributeWithName } from "@/modules/game/helpers/player/player-attribute/player-attribute.helper";
import { GamePlayActions, GamePlayCauses, WitchPotions } from "@/modules/game/enums/game-play.enum";
import { PlayerAttributeNames, PlayerGroups, PlayerInteractionTypes } from "@/modules/game/enums/player.enum";
+import { createGamePlayEligibleTargetsBoundaries } from "@/modules/game/helpers/game-play/game-play-eligible-targets/game-play-eligible-targets-boundaries/game-play-eligible-targets-boundaries.factory";
import { createGamePlayEligibleTargets } from "@/modules/game/helpers/game-play/game-play-eligible-targets/game-play-eligible-targets.factory";
+import { createInteractablePlayer } from "@/modules/game/helpers/game-play/game-play-eligible-targets/interactable-player/interactable-player.factory";
import { createGamePlay } from "@/modules/game/helpers/game-play/game-play.factory";
-import { getAlivePlayers, getAliveVillagerSidedPlayers, getAllowedToVotePlayers, getGroupOfPlayers, getLeftToCharmByPiedPiperPlayers, getLeftToEatByWerewolvesPlayers, getLeftToEatByWhiteWerewolfPlayers, getPlayersWithActiveAttributeName, getPlayersWithCurrentRole, isGameSourceGroup, isGameSourceRole } from "@/modules/game/helpers/game.helper";
+import { getAlivePlayers, getAliveVillagerSidedPlayers, getAllowedToVotePlayers, getGroupOfPlayers, getLeftToCharmByPiedPiperPlayers, getLeftToEatByWerewolvesPlayers, getLeftToEatByWhiteWerewolfPlayers, getPlayersWithActiveAttributeName, getPlayersWithCurrentRole, getPlayerWithCurrentRole, isGameSourceGroup, isGameSourceRole } from "@/modules/game/helpers/game.helper";
+import { doesPlayerHaveActiveAttributeWithName } from "@/modules/game/helpers/player/player-attribute/player-attribute.helper";
+import { createPlayer } from "@/modules/game/helpers/player/player.factory";
+import { isPlayerAliveAndPowerful } from "@/modules/game/helpers/player/player.helper";
import { GameHistoryRecordService } from "@/modules/game/providers/services/game-history/game-history-record.service";
import type { GamePlayEligibleTargetsBoundaries } from "@/modules/game/schemas/game-play/game-play-eligible-targets/game-play-eligible-targets-boundaries/game-play-eligible-targets-boundaries.schema";
import type { GamePlayEligibleTargets } from "@/modules/game/schemas/game-play/game-play-eligible-targets/game-play-eligible-targets.schema";
@@ -18,11 +18,12 @@ import type { InteractablePlayer } from "@/modules/game/schemas/game-play/game-p
import type { PlayerInteraction } from "@/modules/game/schemas/game-play/game-play-eligible-targets/interactable-player/player-interaction/player-interaction.schema";
import type { GamePlay } from "@/modules/game/schemas/game-play/game-play.schema";
import type { Game } from "@/modules/game/schemas/game.schema";
+import type { Player } from "@/modules/game/schemas/player/player.schema";
import type { GamePlaySourceName } from "@/modules/game/types/game-play.type";
import { WEREWOLF_ROLES } from "@/modules/role/constants/role.constant";
import { RoleNames } from "@/modules/role/enums/role.enum";
-import { createCantFindLastNominatedPlayersUnexpectedException, createMalformedCurrentGamePlayUnexpectedException, createNoCurrentGamePlayUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+import { createCantFindLastDeadPlayersUnexpectedException, createCantFindLastNominatedPlayersUnexpectedException, createCantFindPlayerWithCurrentRoleUnexpectedException, createMalformedCurrentGamePlayUnexpectedException, createNoCurrentGamePlayUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
@Injectable()
export class GamePlayAugmenterService {
@@ -94,9 +95,9 @@ export class GamePlayAugmenterService {
}
private getSheriffDelegatesGamePlayEligibleTargets(game: Game): GamePlayEligibleTargets {
- const alivePlayers = getAlivePlayers(game);
+ const alivePlayersWithoutCurrentSheriff = getAlivePlayers(game).filter(player => !doesPlayerHaveActiveAttributeWithName(player, PlayerAttributeNames.SHERIFF, game));
const interactions: PlayerInteraction[] = [{ type: PlayerInteractionTypes.TRANSFER_SHERIFF_ROLE, source: PlayerAttributeNames.SHERIFF }];
- const interactablePlayers: InteractablePlayer[] = alivePlayers.map(player => ({ player, interactions }));
+ const interactablePlayers: InteractablePlayer[] = alivePlayersWithoutCurrentSheriff.map(player => ({ player, interactions }));
const boundaries: GamePlayEligibleTargetsBoundaries = { min: 1, max: 1 };
return createGamePlayEligibleTargets({ interactablePlayers, boundaries });
}
@@ -145,17 +146,36 @@ export class GamePlayAugmenterService {
return createGamePlayEligibleTargets({ interactablePlayers, boundaries });
}
- private async getSurvivorsGamePlayEligibleTargets(game: Game, gamePlay: GamePlay): Promise {
- if (gamePlay.action === GamePlayActions.BURY_DEAD_BODIES) {
+ private async getSurvivorsBuryDeadBodiesGamePlayEligibleTargets(game: Game): Promise {
+ const devotedServantPlayer = getPlayerWithCurrentRole(game, RoleNames.DEVOTED_SERVANT);
+ if (!devotedServantPlayer || !isPlayerAliveAndPowerful(devotedServantPlayer, game) ||
+ doesPlayerHaveActiveAttributeWithName(devotedServantPlayer, PlayerAttributeNames.IN_LOVE, game)) {
return undefined;
}
- if (gamePlay.action === GamePlayActions.VOTE) {
- return this.getSurvivorsVoteGamePlayEligibleTargets(game, gamePlay);
+ const previousGameHistoryRecord = await this.gameHistoryRecordService.getPreviousGameHistoryRecord(game._id);
+ if (previousGameHistoryRecord?.deadPlayers === undefined || previousGameHistoryRecord.deadPlayers.length === 0) {
+ throw createCantFindLastDeadPlayersUnexpectedException("getSurvivorsBuryDeadBodiesGamePlayEligibleTargets", { gameId: game._id });
}
- if (gamePlay.action === GamePlayActions.ELECT_SHERIFF) {
- return this.getSurvivorsElectSheriffGamePlayEligibleTargets(game);
+ const interaction: PlayerInteraction = { type: PlayerInteractionTypes.STEAL_ROLE, source: RoleNames.DEVOTED_SERVANT };
+ const interactablePlayers = previousGameHistoryRecord.deadPlayers.map(player => ({ player, interactions: [interaction] }));
+ const boundaries: GamePlayEligibleTargetsBoundaries = { min: 0, max: 1 };
+ return createGamePlayEligibleTargets({ interactablePlayers, boundaries });
+ }
+
+ private async getSurvivorsGamePlayEligibleTargets(game: Game, gamePlay: GamePlay): Promise {
+ const survivorsGameActionEligibleTargetsMethods: Partial GamePlayEligibleTargets | Promise | undefined
+ >> = {
+ [GamePlayActions.BURY_DEAD_BODIES]: async() => this.getSurvivorsBuryDeadBodiesGamePlayEligibleTargets(game),
+ [GamePlayActions.VOTE]: async() => this.getSurvivorsVoteGamePlayEligibleTargets(game, gamePlay),
+ [GamePlayActions.ELECT_SHERIFF]: () => this.getSurvivorsElectSheriffGamePlayEligibleTargets(game),
+ };
+ const eligibleTargetsMethod = survivorsGameActionEligibleTargetsMethods[gamePlay.action];
+ if (!eligibleTargetsMethod) {
+ throw createMalformedCurrentGamePlayUnexpectedException("getSurvivorsGamePlayEligibleTargets", gamePlay, game._id);
}
- throw createMalformedCurrentGamePlayUnexpectedException("getSurvivorsGamePlayEligibleTargets", gamePlay, game._id);
+ return eligibleTargetsMethod(game, gamePlay);
}
private getWerewolvesGamePlayEligibleTargets(game: Game): GamePlayEligibleTargets {
@@ -194,7 +214,11 @@ export class GamePlayAugmenterService {
private async getDefenderGamePlayEligibleTargets(game: Game): Promise {
const { canProtectTwice } = game.options.roles.defender;
const alivePlayers = getAlivePlayers(game);
- const lastDefenderProtectRecord = await this.gameHistoryRecordService.getLastGameHistoryDefenderProtectsRecord(game._id);
+ const defenderPlayer = getPlayerWithCurrentRole(game, RoleNames.DEFENDER);
+ if (!defenderPlayer) {
+ throw createCantFindPlayerWithCurrentRoleUnexpectedException("getDefenderGamePlayEligibleTargets", { gameId: game._id, roleName: RoleNames.DEFENDER });
+ }
+ const lastDefenderProtectRecord = await this.gameHistoryRecordService.getLastGameHistoryDefenderProtectsRecord(game._id, defenderPlayer._id);
const lastProtectedPlayer = lastDefenderProtectRecord?.play.targets?.[0].player;
const interactions: PlayerInteraction[] = [{ type: PlayerInteractionTypes.PROTECT, source: RoleNames.DEFENDER }];
const possibleDefenderTargets = canProtectTwice || !lastProtectedPlayer ? alivePlayers : alivePlayers.filter(player => !player._id.equals(lastProtectedPlayer._id));
@@ -291,9 +315,13 @@ export class GamePlayAugmenterService {
}
private async getWitchGamePlayEligibleTargets(game: Game): Promise {
+ const witchPlayer = getPlayerWithCurrentRole(game, RoleNames.WITCH);
+ if (!witchPlayer) {
+ throw createCantFindPlayerWithCurrentRoleUnexpectedException("getWitchGamePlayEligibleTargets", { gameId: game._id, roleName: RoleNames.WITCH });
+ }
const [lifeRecords, deathRecords] = await Promise.all([
- this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, WitchPotions.LIFE),
- this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, WitchPotions.DEATH),
+ this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, witchPlayer._id, WitchPotions.LIFE),
+ this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, witchPlayer._id, WitchPotions.DEATH),
]);
const hasWitchUsedLifePotion = lifeRecords.length > 0;
const hasWitchUsedDeathPotion = deathRecords.length > 0;
@@ -318,7 +346,7 @@ export class GamePlayAugmenterService {
if (gamePlay.action === GamePlayActions.ELECT_SHERIFF || isGamePlayVoteCauseAngelPresence) {
return false;
}
- return canBeSkipped;
+ return gamePlay.action === GamePlayActions.BURY_DEAD_BODIES || canBeSkipped;
}
private canBigBadWolfSkipGamePlay(game: Game): boolean {
diff --git a/src/modules/game/providers/services/game-play/game-play-maker/devoted-servant-game-play-maker.service.ts b/src/modules/game/providers/services/game-play/game-play-maker/devoted-servant-game-play-maker.service.ts
new file mode 100644
index 000000000..a06db159c
--- /dev/null
+++ b/src/modules/game/providers/services/game-play/game-play-maker/devoted-servant-game-play-maker.service.ts
@@ -0,0 +1,89 @@
+import { Injectable } from "@nestjs/common";
+
+import { PlayerAttributeNames } from "@/modules/game/enums/player.enum";
+import { createGamePlaySheriffDelegates } from "@/modules/game/helpers/game-play/game-play.factory";
+import { createGame } from "@/modules/game/helpers/game.factory";
+import { getPlayerWithActiveAttributeName, getPlayerWithCurrentRole, getPlayerWithIdOrThrow } from "@/modules/game/helpers/game.helper";
+import { addPlayerAttributeInGame, prependUpcomingPlayInGame, removePlayerAttributeByNameAndSourceInGame, removePlayerAttributeByNameInGame, updatePlayerInGame } from "@/modules/game/helpers/game.mutator";
+import { createStolenRoleByDevotedServantPlayerAttribute } from "@/modules/game/helpers/player/player-attribute/player-attribute.factory";
+import { canPlayerDelegateSheriffAttribute } from "@/modules/game/helpers/player/player-attribute/player-attribute.helper";
+import type { Game } from "@/modules/game/schemas/game.schema";
+import type { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
+import type { Player } from "@/modules/game/schemas/player/player.schema";
+import { RoleNames, RoleSides } from "@/modules/role/enums/role.enum";
+
+import { createCantFindPlayerWithIdUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+
+@Injectable()
+export class DevotedServantGamePlayMakerService {
+ public devotedServantStealsRole(targetedPlayer: DeadPlayer, game: Game): Game {
+ let clonedGame = createGame(game);
+ let devotedServantPlayer = getPlayerWithCurrentRole(clonedGame, RoleNames.DEVOTED_SERVANT);
+ if (!devotedServantPlayer) {
+ return clonedGame;
+ }
+ const cantFindDevotedServantException = createCantFindPlayerWithIdUnexpectedException("devotedServantStealsRole", { gameId: game._id, playerId: devotedServantPlayer._id });
+ clonedGame = removePlayerAttributeByNameAndSourceInGame(devotedServantPlayer._id, clonedGame, PlayerAttributeNames.CHARMED, RoleNames.PIED_PIPER);
+ devotedServantPlayer = getPlayerWithIdOrThrow(devotedServantPlayer._id, clonedGame, cantFindDevotedServantException);
+ clonedGame = this.swapTargetAndDevotedServantCurrentRoleAndSide(targetedPlayer, devotedServantPlayer, clonedGame);
+ devotedServantPlayer = getPlayerWithIdOrThrow(devotedServantPlayer._id, clonedGame, cantFindDevotedServantException);
+ clonedGame = this.makeDevotedServantDelegatesIfSheriff(devotedServantPlayer, clonedGame);
+ clonedGame = this.applyTargetStolenRoleOutcomes(targetedPlayer, clonedGame);
+ return addPlayerAttributeInGame(targetedPlayer._id, clonedGame, createStolenRoleByDevotedServantPlayerAttribute());
+ }
+
+ private applyWildChildStolenRoleOutcome(game: Game): Game {
+ const clonedGame = createGame(game);
+ const worshipedPlayer = getPlayerWithActiveAttributeName(clonedGame, PlayerAttributeNames.WORSHIPED);
+ if (!worshipedPlayer) {
+ return clonedGame;
+ }
+ return removePlayerAttributeByNameInGame(worshipedPlayer._id, clonedGame, PlayerAttributeNames.WORSHIPED);
+ }
+
+ private applyTargetStolenRoleOutcomes(targetedPlayer: DeadPlayer, game: Game): Game {
+ const roleOutcomesMethods: Partial Game>> = { [RoleNames.WILD_CHILD]: () => this.applyWildChildStolenRoleOutcome(game) };
+ const roleOutcomeMethod = roleOutcomesMethods[targetedPlayer.role.current];
+ if (!roleOutcomeMethod) {
+ return game;
+ }
+ return roleOutcomeMethod(game);
+ }
+
+ private swapTargetAndDevotedServantCurrentRoleAndSide(targetedPlayer: DeadPlayer, devotedServantPlayer: Player, game: Game): Game {
+ let clonedGame = createGame(game);
+ const devotedServantPlayerDataToUpdate: Partial = {
+ role: {
+ ...devotedServantPlayer.role,
+ current: targetedPlayer.role.current,
+ isRevealed: targetedPlayer.role.isRevealed,
+ },
+ };
+ if (devotedServantPlayer.side.current !== RoleSides.WEREWOLVES) {
+ devotedServantPlayerDataToUpdate.side = {
+ ...devotedServantPlayer.side,
+ current: targetedPlayer.side.original,
+ };
+ }
+ const targetPlayerDataToUpdate: Partial = {
+ role: {
+ ...targetedPlayer.role,
+ current: devotedServantPlayer.role.current,
+ },
+ side: {
+ ...targetedPlayer.side,
+ current: RoleSides.VILLAGERS,
+ },
+ };
+ clonedGame = updatePlayerInGame(devotedServantPlayer._id, devotedServantPlayerDataToUpdate, clonedGame);
+ return updatePlayerInGame(targetedPlayer._id, targetPlayerDataToUpdate, clonedGame);
+ }
+
+ private makeDevotedServantDelegatesIfSheriff(devotedServantPlayer: Player, game: Game): Game {
+ const clonedGame = createGame(game);
+ if (!canPlayerDelegateSheriffAttribute(devotedServantPlayer, clonedGame)) {
+ return clonedGame;
+ }
+ return prependUpcomingPlayInGame(createGamePlaySheriffDelegates(), clonedGame);
+ }
+}
\ No newline at end of file
diff --git a/src/modules/game/providers/services/game-play/game-play-maker.service.ts b/src/modules/game/providers/services/game-play/game-play-maker/game-play-maker.service.ts
similarity index 86%
rename from src/modules/game/providers/services/game-play/game-play-maker.service.ts
rename to src/modules/game/providers/services/game-play/game-play-maker/game-play-maker.service.ts
index 4ef8588ef..9db7b5a16 100644
--- a/src/modules/game/providers/services/game-play/game-play-maker.service.ts
+++ b/src/modules/game/providers/services/game-play/game-play-maker/game-play-maker.service.ts
@@ -1,14 +1,17 @@
import { Injectable } from "@nestjs/common";
import { sample } from "lodash";
+import type { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
+import { DevotedServantGamePlayMakerService } from "@/modules/game/providers/services/game-play/game-play-maker/devoted-servant-game-play-maker.service";
+import { GameHistoryRecordService } from "@/modules/game/providers/services/game-history/game-history-record.service";
import type { MakeGamePlayWithRelationsDto } from "@/modules/game/dto/make-game-play/make-game-play-with-relations.dto";
import { GamePlayActions, GamePlayCauses, WitchPotions } from "@/modules/game/enums/game-play.enum";
import { PlayerAttributeNames, PlayerGroups } from "@/modules/game/enums/player.enum";
import { createGamePlaySheriffSettlesVotes, createGamePlaySurvivorsElectSheriff, createGamePlaySurvivorsVote } from "@/modules/game/helpers/game-play/game-play.factory";
import { createGame, createGameWithCurrentGamePlay } from "@/modules/game/helpers/game.factory";
-import { getFoxSniffedPlayers, getPlayerWithActiveAttributeName, getPlayerWithCurrentRole } from "@/modules/game/helpers/game.helper";
+import { getFoxSniffedPlayers, getPlayersWithIds, getPlayerWithActiveAttributeName, getPlayerWithCurrentRole } from "@/modules/game/helpers/game.helper";
import { addPlayerAttributeInGame, addPlayersAttributeInGame, appendUpcomingPlayInGame, prependUpcomingPlayInGame, removePlayerAttributeByNameInGame, updateAdditionalCardInGame, updatePlayerInGame } from "@/modules/game/helpers/game.mutator";
-import { createCantVoteByScapegoatPlayerAttribute, createCharmedByPiedPiperPlayerAttribute, createDrankDeathPotionByWitchPlayerAttribute, createDrankLifePotionByWitchPlayerAttribute, createEatenByBigBadWolfPlayerAttribute, createEatenByWerewolvesPlayerAttribute, createEatenByWhiteWerewolfPlayerAttribute, createInLoveByCupidPlayerAttribute, createPowerlessByAccursedWolfFatherPlayerAttribute, createPowerlessByActorPlayerAttribute, createPowerlessByFoxPlayerAttribute, createProtectedByDefenderPlayerAttribute, createScandalmongerMarkByScandalmongerPlayerAttribute, createSeenBySeerPlayerAttribute, createSheriffBySheriffPlayerAttribute, createSheriffBySurvivorsPlayerAttribute, createWorshipedByWildChildPlayerAttribute } from "@/modules/game/helpers/player/player-attribute/player-attribute.factory";
+import { createActingByActorPlayerAttribute, createCantVoteByScapegoatPlayerAttribute, createCharmedByPiedPiperPlayerAttribute, createDrankDeathPotionByWitchPlayerAttribute, createDrankLifePotionByWitchPlayerAttribute, createEatenByBigBadWolfPlayerAttribute, createEatenByWerewolvesPlayerAttribute, createEatenByWhiteWerewolfPlayerAttribute, createInLoveByCupidPlayerAttribute, createPowerlessByAccursedWolfFatherPlayerAttribute, createPowerlessByActorPlayerAttribute, createPowerlessByFoxPlayerAttribute, createProtectedByDefenderPlayerAttribute, createScandalmongerMarkByScandalmongerPlayerAttribute, createSeenBySeerPlayerAttribute, createSheriffBySheriffPlayerAttribute, createSheriffBySurvivorsPlayerAttribute, createWorshipedByWildChildPlayerAttribute } from "@/modules/game/helpers/player/player-attribute/player-attribute.factory";
import { createPlayerShotByHunterDeath, createPlayerVoteBySheriffDeath, createPlayerVoteBySurvivorsDeath, createPlayerVoteScapegoatedBySurvivorsDeath } from "@/modules/game/helpers/player/player-death/player-death.factory";
import { isPlayerAliveAndPowerful } from "@/modules/game/helpers/player/player.helper";
import { GamePlayVoteService } from "@/modules/game/providers/services/game-play/game-play-vote/game-play-vote.service";
@@ -24,7 +27,7 @@ import { RoleNames, RoleSides } from "@/modules/role/enums/role.enum";
import { getRoleWithName } from "@/modules/role/helpers/role.helper";
import type { Role } from "@/modules/role/types/role.type";
-import { createNoCurrentGamePlayUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+import { createCantFindLastDeadPlayersUnexpectedException, createNoCurrentGamePlayUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
@Injectable()
export class GamePlayMakerService {
@@ -52,6 +55,8 @@ export class GamePlayMakerService {
public constructor(
private readonly playerKillerService: PlayerKillerService,
private readonly gamePlayVoteService: GamePlayVoteService,
+ private readonly gameHistoryRecordService: GameHistoryRecordService,
+ private readonly devotedServantGamePlayMakerService: DevotedServantGamePlayMakerService,
) {}
public async makeGamePlay(play: MakeGamePlayWithRelationsDto, game: Game): Promise {
@@ -73,8 +78,11 @@ export class GamePlayMakerService {
if (!chosenRole) {
return clonedGame;
}
- const newActorRole: PlayerRole = { ...actorPlayer.role, current: chosenRole.name };
- clonedGame = updatePlayerInGame(actorPlayer._id, { role: newActorRole }, clonedGame);
+ const actorDataToUpdate: Partial = {
+ role: { ...actorPlayer.role, current: chosenRole.name },
+ attributes: [...actorPlayer.attributes, createActingByActorPlayerAttribute()],
+ };
+ clonedGame = updatePlayerInGame(actorPlayer._id, actorDataToUpdate, clonedGame);
return updateAdditionalCardInGame(chosenCard._id, { isUsed: true }, clonedGame);
}
@@ -117,6 +125,28 @@ export class GamePlayMakerService {
return sheriffPlayMethod();
}
+ private async survivorsBuryDeadBodies({ targets }: MakeGamePlayWithRelationsDto, game: GameWithCurrentPlay): Promise {
+ let clonedGame = createGame(game);
+ const { areRevealedOnDeath: areRolesRevealedOnDeath } = clonedGame.options.roles;
+ const previousGameHistoryRecord = await this.gameHistoryRecordService.getPreviousGameHistoryRecord(clonedGame._id);
+ if (previousGameHistoryRecord?.deadPlayers === undefined || previousGameHistoryRecord.deadPlayers.length === 0) {
+ throw createCantFindLastDeadPlayersUnexpectedException("survivorsBuryDeadBodies", { gameId: clonedGame._id });
+ }
+ const expectedTargetCountForDevotedServant = 1;
+ if (targets?.length === expectedTargetCountForDevotedServant) {
+ clonedGame = this.devotedServantGamePlayMakerService.devotedServantStealsRole(targets[0].player as DeadPlayer, clonedGame);
+ }
+ const previousDeadPlayersIds = previousGameHistoryRecord.deadPlayers.map(({ _id }) => _id);
+ const previousDeadPlayersInGame = getPlayersWithIds(previousDeadPlayersIds, clonedGame) as DeadPlayer[];
+ for (const deadPlayer of previousDeadPlayersInGame) {
+ if (areRolesRevealedOnDeath) {
+ clonedGame = this.playerKillerService.revealPlayerRole(deadPlayer, clonedGame);
+ }
+ clonedGame = this.playerKillerService.applyPlayerDeathOutcomes(deadPlayer, clonedGame);
+ }
+ return clonedGame;
+ }
+
private async handleTieInVotes(game: GameWithCurrentPlay): Promise {
const clonedGame = createGameWithCurrentGamePlay(game);
const { mustSettleTieInVotes: mustSheriffSettleTieInVotes } = clonedGame.options.roles.sheriff;
@@ -187,6 +217,7 @@ export class GamePlayMakerService {
const survivorsPlayMethods: Partial Game | Promise>> = {
[GamePlayActions.ELECT_SHERIFF]: () => this.survivorsElectSheriff(play, clonedGame),
[GamePlayActions.VOTE]: async() => this.survivorsVote(play, clonedGame),
+ [GamePlayActions.BURY_DEAD_BODIES]: async() => this.survivorsBuryDeadBodies(play, clonedGame),
};
const survivorsPlayMethod = survivorsPlayMethods[clonedGame.currentPlay.action];
if (survivorsPlayMethod === undefined) {
diff --git a/src/modules/game/providers/services/game-play/game-play-validator.service.ts b/src/modules/game/providers/services/game-play/game-play-validator.service.ts
index 0bbfb61e7..c94f6a4f9 100644
--- a/src/modules/game/providers/services/game-play/game-play-validator.service.ts
+++ b/src/modules/game/providers/services/game-play/game-play-validator.service.ts
@@ -1,5 +1,6 @@
import { Injectable } from "@nestjs/common";
+import { doesPlayerHaveActiveAttributeWithName } from "@/modules/game/helpers/player/player-attribute/player-attribute.helper";
import { isPlayerInteractableWithInteractionType } from "@/modules/game/helpers/game-play/game-play.helper";
import { STUTTERING_JUDGE_REQUEST_OPPORTUNITY_ACTIONS, TARGET_ACTIONS, VOTE_ACTIONS } from "@/modules/game/constants/game-play/game-play.constant";
import type { MakeGamePlayTargetWithRelationsDto } from "@/modules/game/dto/make-game-play/make-game-play-target/make-game-play-target-with-relations.dto";
@@ -18,7 +19,7 @@ import type { GameWithCurrentPlay } from "@/modules/game/types/game-with-current
import { RoleNames } from "@/modules/role/enums/role.enum";
import { BadGamePlayPayloadReasons } from "@/shared/exception/enums/bad-game-play-payload-error.enum";
-import { createNoCurrentGamePlayUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+import { createCantFindPlayerWithCurrentRoleUnexpectedException, createNoCurrentGamePlayUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
import { BadGamePlayPayloadException } from "@/shared/exception/types/bad-game-play-payload-exception.type";
@Injectable()
@@ -79,6 +80,23 @@ export class GamePlayValidatorService {
}
}
+ private validateGamePlaySurvivorsTargets(playTargets: MakeGamePlayTargetWithRelationsDto[], game: GameWithCurrentPlay): void {
+ const { action } = game.currentPlay;
+ if (!playTargets.length || action !== GamePlayActions.BURY_DEAD_BODIES) {
+ return;
+ }
+ const devotedServantPlayer = getPlayerWithCurrentRole(game, RoleNames.DEVOTED_SERVANT);
+ if (!devotedServantPlayer || !isPlayerAliveAndPowerful(devotedServantPlayer, game) ||
+ doesPlayerHaveActiveAttributeWithName(devotedServantPlayer, PlayerAttributeNames.IN_LOVE, game)) {
+ throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.DEVOTED_SERVANT_CANT_STEAL_ROLE);
+ }
+ const targetedPlayer = playTargets[0].player;
+ const canRoleTargetedPlayerBeStolen = isPlayerInteractableWithInteractionType(targetedPlayer._id, PlayerInteractionTypes.STEAL_ROLE, game);
+ if (!canRoleTargetedPlayerBeStolen) {
+ throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.BAD_DEVOTED_SERVANT_TARGET);
+ }
+ }
+
private validateDrankLifePotionTargets(drankLifePotionTargets: MakeGamePlayTargetWithRelationsDto[], game: GameWithCurrentPlay): void {
if (drankLifePotionTargets.length > 1) {
throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.TOO_MUCH_DRANK_LIFE_POTION_TARGETS);
@@ -98,9 +116,13 @@ export class GamePlayValidatorService {
}
private async validateGamePlayWitchTargets(playTargets: MakeGamePlayTargetWithRelationsDto[], game: GameWithCurrentPlay): Promise {
- const hasWitchUsedLifePotion = (await this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, WitchPotions.LIFE)).length > 0;
+ const witchPlayer = getPlayerWithCurrentRole(game, RoleNames.WITCH);
+ if (!witchPlayer) {
+ throw createCantFindPlayerWithCurrentRoleUnexpectedException("validateGamePlayWitchTargets", { gameId: game._id, roleName: RoleNames.WITCH });
+ }
+ const hasWitchUsedLifePotion = (await this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, witchPlayer._id, WitchPotions.LIFE)).length > 0;
const drankLifePotionTargets = playTargets.filter(({ drankPotion }) => drankPotion === WitchPotions.LIFE);
- const hasWitchUsedDeathPotion = (await this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, WitchPotions.DEATH)).length > 0;
+ const hasWitchUsedDeathPotion = (await this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, witchPlayer._id, WitchPotions.DEATH)).length > 0;
const drankDeathPotionTargets = playTargets.filter(({ drankPotion }) => drankPotion === WitchPotions.DEATH);
if (hasWitchUsedLifePotion && drankLifePotionTargets.length || hasWitchUsedDeathPotion && drankDeathPotionTargets.length) {
throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.UNEXPECTED_DRANK_POTION_TARGET);
@@ -114,9 +136,12 @@ export class GamePlayValidatorService {
if (!infectedTargets.length) {
return;
}
- const hasAccursedWolfFatherInfected = (await this.gameHistoryRecordService.getGameHistoryAccursedWolfFatherInfectedRecords(game._id)).length > 0;
const accursedWolfFatherPlayer = getPlayerWithCurrentRole(game, RoleNames.ACCURSED_WOLF_FATHER);
- if (!accursedWolfFatherPlayer || !isPlayerAliveAndPowerful(accursedWolfFatherPlayer, game) || hasAccursedWolfFatherInfected) {
+ if (!accursedWolfFatherPlayer || !isPlayerAliveAndPowerful(accursedWolfFatherPlayer, game)) {
+ throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.UNEXPECTED_INFECTED_TARGET);
+ }
+ const hasAccursedWolfFatherInfected = (await this.gameHistoryRecordService.getGameHistoryAccursedWolfFatherInfectedRecords(game._id, accursedWolfFatherPlayer._id)).length > 0;
+ if (hasAccursedWolfFatherInfected) {
throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.UNEXPECTED_INFECTED_TARGET);
}
this.validateGamePlayTargetsBoundaries(infectedTargets, { min: 1, max: 1 });
@@ -233,6 +258,7 @@ export class GamePlayValidatorService {
private async validateGamePlaySourceTargets(playTargets: MakeGamePlayTargetWithRelationsDto[], game: GameWithCurrentPlay): Promise {
const gamePlaySourceValidationMethods: Partial Promise | void>> = {
[PlayerAttributeNames.SHERIFF]: () => this.validateGamePlaySheriffTargets(playTargets, game),
+ [PlayerGroups.SURVIVORS]: () => this.validateGamePlaySurvivorsTargets(playTargets, game),
[PlayerGroups.WEREWOLVES]: async() => this.validateGamePlayWerewolvesTargets(playTargets, game),
[RoleNames.BIG_BAD_WOLF]: async() => this.validateGamePlayWerewolvesTargets(playTargets, game),
[RoleNames.WHITE_WEREWOLF]: async() => this.validateGamePlayWerewolvesTargets(playTargets, game),
@@ -345,12 +371,14 @@ export class GamePlayValidatorService {
}
const { voteRequestsCount } = game.options.roles.stutteringJudge;
const didJudgeMakeHisSign = await this.gameHistoryRecordService.didJudgeMakeHisSign(game._id);
- const gameHistoryJudgeRequestRecords = await this.gameHistoryRecordService.getGameHistoryJudgeRequestRecords(game._id);
const stutteringJudgePlayer = getPlayerWithCurrentRole(game, RoleNames.STUTTERING_JUDGE);
const stutteringJudgeRequestOpportunityActions: GamePlayActions[] = [...STUTTERING_JUDGE_REQUEST_OPPORTUNITY_ACTIONS];
if (!stutteringJudgeRequestOpportunityActions.includes(game.currentPlay.action) || !didJudgeMakeHisSign ||
- !stutteringJudgePlayer || !isPlayerAliveAndPowerful(stutteringJudgePlayer, game) ||
- gameHistoryJudgeRequestRecords.length >= voteRequestsCount) {
+ !stutteringJudgePlayer || !isPlayerAliveAndPowerful(stutteringJudgePlayer, game)) {
+ throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.UNEXPECTED_STUTTERING_JUDGE_VOTE_REQUEST);
+ }
+ const gameHistoryJudgeRequestRecords = await this.gameHistoryRecordService.getGameHistoryJudgeRequestRecords(game._id, stutteringJudgePlayer._id);
+ if (gameHistoryJudgeRequestRecords.length >= voteRequestsCount) {
throw new BadGamePlayPayloadException(BadGamePlayPayloadReasons.UNEXPECTED_STUTTERING_JUDGE_VOTE_REQUEST);
}
}
diff --git a/src/modules/game/providers/services/game-play/game-play.service.ts b/src/modules/game/providers/services/game-play/game-play.service.ts
index aae5d295c..e39916fa7 100644
--- a/src/modules/game/providers/services/game-play/game-play.service.ts
+++ b/src/modules/game/providers/services/game-play/game-play.service.ts
@@ -168,7 +168,7 @@ export class GamePlayService {
if (!player || !isPlayerAliveAndPowerful(player, game)) {
return false;
}
- return !await this.gameHistoryRecordService.hasGamePlayBeenMade(game._id, gamePlay);
+ return !await this.gameHistoryRecordService.hasGamePlayBeenMadeByPlayer(game._id, gamePlay, player);
}
private isActorGamePlaySuitableForCurrentPhase(game: CreateGameDto | Game): boolean {
@@ -184,11 +184,18 @@ export class GamePlayService {
if (game instanceof CreateGameDto) {
return !!getPlayerDtoWithRole(game, RoleNames.WITCH);
}
- const hasWitchUsedLifePotion = (await this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, WitchPotions.LIFE)).length > 0;
- const hasWitchUsedDeathPotion = (await this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, WitchPotions.DEATH)).length > 0;
- const { doSkipCallIfNoTarget } = game.options.roles;
const witchPlayer = getPlayerWithCurrentRole(game, RoleNames.WITCH);
- return !!witchPlayer && isPlayerAliveAndPowerful(witchPlayer, game) && (!doSkipCallIfNoTarget || !hasWitchUsedLifePotion || !hasWitchUsedDeathPotion);
+ if (!witchPlayer || !isPlayerAliveAndPowerful(witchPlayer, game)) {
+ return false;
+ }
+ const [lifePotionRecords, deathPotionRecords] = await Promise.all([
+ this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, witchPlayer._id, WitchPotions.LIFE),
+ this.gameHistoryRecordService.getGameHistoryWitchUsesSpecificPotionRecords(game._id, witchPlayer._id, WitchPotions.DEATH),
+ ]);
+ const hasWitchUsedLifePotion = lifePotionRecords.length > 0;
+ const hasWitchUsedDeathPotion = deathPotionRecords.length > 0;
+ const { doSkipCallIfNoTarget } = game.options.roles;
+ return !doSkipCallIfNoTarget || !hasWitchUsedLifePotion || !hasWitchUsedDeathPotion;
}
private shouldBeCalledOnCurrentTurnInterval(wakingUpInterval: number, game: CreateGameDto | Game): boolean {
@@ -247,6 +254,18 @@ export class GamePlayService {
return shouldTwoSistersBeCalledOnCurrentTurn && twoSistersPlayers.length > 0 && twoSistersPlayers.every(sister => sister.isAlive);
}
+ private isCupidGamePlaySuitableForCurrentPhase(game: CreateGameDto | Game): boolean {
+ if (game instanceof CreateGameDto) {
+ return !!getPlayerDtoWithRole(game, RoleNames.CUPID);
+ }
+ const cupidPlayer = getPlayerWithCurrentRole(game, RoleNames.CUPID);
+ if (!cupidPlayer || !isPlayerAliveAndPowerful(cupidPlayer, game)) {
+ return false;
+ }
+ const inLovePlayers = getPlayersWithActiveAttributeName(game, PlayerAttributeNames.IN_LOVE);
+ return !inLovePlayers.length;
+ }
+
private async isRoleGamePlaySuitableForCurrentPhase(game: CreateGameDto | Game, gamePlay: GamePlay): Promise {
const source = gamePlay.source.name as RoleNames;
const player = game instanceof CreateGameDto ? getPlayerDtoWithRole(game, source) : getPlayerWithCurrentRole(game, source);
@@ -254,6 +273,7 @@ export class GamePlayService {
return false;
}
const specificRoleMethods: Partial Promise | boolean>> = {
+ [RoleNames.CUPID]: () => this.isCupidGamePlaySuitableForCurrentPhase(game),
[RoleNames.TWO_SISTERS]: () => this.isTwoSistersGamePlaySuitableForCurrentPhase(game),
[RoleNames.THREE_BROTHERS]: () => this.isThreeBrothersGamePlaySuitableForCurrentPhase(game),
[RoleNames.BIG_BAD_WOLF]: () => this.isBigBadWolfGamePlaySuitableForCurrentPhase(game),
diff --git a/src/modules/game/providers/services/game.service.ts b/src/modules/game/providers/services/game.service.ts
index 2c67121d8..ea55a6417 100644
--- a/src/modules/game/providers/services/game.service.ts
+++ b/src/modules/game/providers/services/game.service.ts
@@ -12,7 +12,7 @@ import { createGame as createGameFromFactory } from "@/modules/game/helpers/game
import { GameRepository } from "@/modules/game/providers/repositories/game.repository";
import { GameHistoryRecordService } from "@/modules/game/providers/services/game-history/game-history-record.service";
import { GamePhaseService } from "@/modules/game/providers/services/game-phase/game-phase.service";
-import { GamePlayMakerService } from "@/modules/game/providers/services/game-play/game-play-maker.service";
+import { GamePlayMakerService } from "@/modules/game/providers/services/game-play/game-play-maker/game-play-maker.service";
import { GamePlayValidatorService } from "@/modules/game/providers/services/game-play/game-play-validator.service";
import { GamePlayService } from "@/modules/game/providers/services/game-play/game-play.service";
import { PlayerAttributeService } from "@/modules/game/providers/services/player/player-attribute.service";
diff --git a/src/modules/game/providers/services/player/player-killer.service.ts b/src/modules/game/providers/services/player/player-killer.service.ts
index dadb487d4..399c39bbf 100644
--- a/src/modules/game/providers/services/player/player-killer.service.ts
+++ b/src/modules/game/providers/services/player/player-killer.service.ts
@@ -1,16 +1,17 @@
import { Injectable } from "@nestjs/common";
import type { Types } from "mongoose";
+import type { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
import { GamePlayActions } from "@/modules/game/enums/game-play.enum";
import { PlayerAttributeNames, PlayerDeathCauses, PlayerGroups } from "@/modules/game/enums/player.enum";
import { createGamePlayHunterShoots, createGamePlayScapegoatBansVoting, createGamePlaySheriffDelegates, createGamePlaySurvivorsBuryDeadBodies } from "@/modules/game/helpers/game-play/game-play.factory";
import { createGame } from "@/modules/game/helpers/game.factory";
-import { doesGameHaveCurrentOrUpcomingPlaySourceAndAction, getAliveVillagerSidedPlayers, getNearestAliveNeighbor, getPlayerWithCurrentRole, getPlayerWithIdOrThrow } from "@/modules/game/helpers/game.helper";
+import { doesGameHaveUpcomingPlaySourceAndAction, getAliveVillagerSidedPlayers, getNearestAliveNeighbor, getPlayerWithCurrentRole, getPlayerWithIdOrThrow } from "@/modules/game/helpers/game.helper";
import { addPlayerAttributeInGame, addPlayersAttributeInGame, prependUpcomingPlayInGame, updatePlayerInGame } from "@/modules/game/helpers/game.mutator";
import { createCantVoteBySurvivorsPlayerAttribute, createContaminatedByRustySwordKnightPlayerAttribute, createPowerlessByActorPlayerAttribute, createPowerlessByElderPlayerAttribute, createPowerlessByWerewolvesPlayerAttribute } from "@/modules/game/helpers/player/player-attribute/player-attribute.factory";
-import { doesPlayerHaveActiveAttributeWithName, doesPlayerHaveActiveAttributeWithNameAndSource } from "@/modules/game/helpers/player/player-attribute/player-attribute.helper";
+import { canPlayerDelegateSheriffAttribute, doesPlayerHaveActiveAttributeWithName, doesPlayerHaveActiveAttributeWithNameAndSource } from "@/modules/game/helpers/player/player-attribute/player-attribute.helper";
import { createPlayerBrokenHeartByCupidDeath, createPlayerDeath, createPlayerReconsiderPardonBySurvivorsDeath } from "@/modules/game/helpers/player/player-death/player-death.factory";
-import { createPlayer } from "@/modules/game/helpers/player/player.factory";
+import { createDeadPlayer, createPlayer } from "@/modules/game/helpers/player/player.factory";
import { isPlayerAliveAndPowerful, isPlayerPowerful } from "@/modules/game/helpers/player/player.helper";
import { GameHistoryRecordService } from "@/modules/game/providers/services/game-history/game-history-record.service";
import type { Game } from "@/modules/game/schemas/game.schema";
@@ -18,20 +19,18 @@ import type { PlayerDeath } from "@/modules/game/schemas/player/player-death/pla
import type { Player } from "@/modules/game/schemas/player/player.schema";
import { RoleNames, RoleSides } from "@/modules/role/enums/role.enum";
-import { createCantFindPlayerUnexpectedException, createPlayerIsDeadUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
+import { createCantFindPlayerWithIdUnexpectedException, createPlayerIsDeadUnexpectedException } from "@/shared/exception/helpers/unexpected-exception.factory";
@Injectable()
export class PlayerKillerService {
public constructor(private readonly gameHistoryRecordService: GameHistoryRecordService) {}
public async killOrRevealPlayer(playerId: Types.ObjectId, game: Game, death: PlayerDeath): Promise {
- let clonedGame = createGame(game);
- let playerToKill = this.getPlayerToKillInGame(playerId, clonedGame);
+ const clonedGame = createGame(game);
+ const playerToKill = this.getPlayerToKillOrRevealInGame(playerId, clonedGame);
if (await this.isPlayerKillable(playerToKill, clonedGame, death.cause)) {
- clonedGame = this.killPlayer(playerToKill, clonedGame, death);
+ return this.killPlayer(playerToKill, clonedGame, death);
}
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("killOrRevealPlayer", { gameId: game._id, playerId: playerToKill._id });
- playerToKill = getPlayerWithIdOrThrow(playerToKill._id, clonedGame, cantFindPlayerException);
if (this.doesPlayerRoleMustBeRevealed(playerToKill, death, game)) {
return this.revealPlayerRole(playerToKill, clonedGame);
}
@@ -48,9 +47,9 @@ export class PlayerKillerService {
public async getElderLivesCountAgainstWerewolves(game: Game, elderPlayer: Player): Promise {
const { livesCountAgainstWerewolves } = game.options.roles.elder;
- const werewolvesEatElderRecords = await this.gameHistoryRecordService.getGameHistoryWerewolvesEatElderRecords(game._id);
+ const werewolvesEatElderRecords = await this.gameHistoryRecordService.getGameHistoryWerewolvesEatElderRecords(game._id, elderPlayer._id);
const werewolvesEatElderOnPreviousTurnsRecords = werewolvesEatElderRecords.filter(({ turn }) => turn < game.turn);
- const elderProtectedFromWerewolvesRecords = await this.gameHistoryRecordService.getGameHistoryElderProtectedFromWerewolvesRecords(game._id);
+ const elderProtectedFromWerewolvesRecords = await this.gameHistoryRecordService.getGameHistoryElderProtectedFromWerewolvesRecords(game._id, elderPlayer._id);
const doesElderLooseALifeOnCurrentTurn = doesPlayerHaveActiveAttributeWithName(elderPlayer, PlayerAttributeNames.EATEN, game) && this.canPlayerBeEaten(elderPlayer, game);
return werewolvesEatElderOnPreviousTurnsRecords.reduce((acc, werewolvesEatElderRecord) => {
const wasElderProtectedFromWerewolves = !!elderProtectedFromWerewolvesRecords.find(({ turn }) => turn === werewolvesEatElderRecord.turn);
@@ -61,24 +60,36 @@ export class PlayerKillerService {
}, doesElderLooseALifeOnCurrentTurn ? livesCountAgainstWerewolves - 1 : livesCountAgainstWerewolves);
}
- private applyPlayerRoleRevelationOutcomes(revealedPlayer: Player, game: Game): Game {
- const clonedGame = createGame(game);
- if (revealedPlayer.role.current === RoleNames.IDIOT) {
- return addPlayerAttributeInGame(revealedPlayer._id, clonedGame, createCantVoteBySurvivorsPlayerAttribute());
- }
- return clonedGame;
+ public applyPlayerDeathOutcomes(deadPlayer: DeadPlayer, game: Game): Game {
+ let clonedGame = createGame(game);
+ let clonedDeadPlayer = createDeadPlayer(deadPlayer);
+ const cantFindPlayerException = createCantFindPlayerWithIdUnexpectedException("applyPlayerDeathOutcomes", { gameId: game._id, playerId: deadPlayer._id });
+ clonedGame = this.applyPlayerRoleDeathOutcomes(clonedDeadPlayer, clonedGame);
+ clonedDeadPlayer = getPlayerWithIdOrThrow(clonedDeadPlayer._id, clonedGame, cantFindPlayerException) as DeadPlayer;
+ clonedGame = this.applyPlayerSideDeathOutcomes(clonedDeadPlayer, clonedGame);
+ clonedDeadPlayer = getPlayerWithIdOrThrow(clonedDeadPlayer._id, clonedGame, cantFindPlayerException) as DeadPlayer;
+ clonedGame = this.applyPlayerAttributesDeathOutcomes(clonedDeadPlayer, clonedGame);
+ return updatePlayerInGame(clonedDeadPlayer._id, this.removePlayerAttributesAfterDeath(clonedDeadPlayer), clonedGame);
}
- private revealPlayerRole(playerToReveal: Player, game: Game): Game {
+ public revealPlayerRole(playerToReveal: Player, game: Game): Game {
let clonedGame = createGame(game);
let clonedPlayerToReveal = createPlayer(playerToReveal);
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("revealPlayerRole", { gameId: game._id, playerId: playerToReveal._id });
+ const cantFindPlayerException = createCantFindPlayerWithIdUnexpectedException("revealPlayerRole", { gameId: game._id, playerId: playerToReveal._id });
clonedPlayerToReveal.role.isRevealed = true;
clonedGame = updatePlayerInGame(playerToReveal._id, clonedPlayerToReveal, clonedGame);
clonedPlayerToReveal = getPlayerWithIdOrThrow(playerToReveal._id, clonedGame, cantFindPlayerException);
return this.applyPlayerRoleRevelationOutcomes(clonedPlayerToReveal, clonedGame);
}
+ private applyPlayerRoleRevelationOutcomes(revealedPlayer: Player, game: Game): Game {
+ const clonedGame = createGame(game);
+ if (revealedPlayer.role.current === RoleNames.IDIOT) {
+ return addPlayerAttributeInGame(revealedPlayer._id, clonedGame, createCantVoteBySurvivorsPlayerAttribute());
+ }
+ return clonedGame;
+ }
+
private doesPlayerRoleMustBeRevealed(playerToReveal: Player, death: PlayerDeath, game: Game): boolean {
const doesIdiotRoleMustBeRevealed = isPlayerPowerful(playerToReveal, game) && death.cause === PlayerDeathCauses.VOTE;
return !playerToReveal.role.isRevealed && (!playerToReveal.isAlive && game.options.roles.areRevealedOnDeath ||
@@ -144,8 +155,7 @@ export class PlayerKillerService {
private applySheriffPlayerDeathOutcomes(killedPlayer: Player, game: Game): Game {
const clonedGame = createGame(game);
- if (!doesPlayerHaveActiveAttributeWithName(killedPlayer, PlayerAttributeNames.SHERIFF, game) ||
- killedPlayer.role.current === RoleNames.IDIOT && isPlayerPowerful(killedPlayer, clonedGame)) {
+ if (!canPlayerDelegateSheriffAttribute(killedPlayer, clonedGame)) {
return clonedGame;
}
return prependUpcomingPlayInGame(createGamePlaySheriffDelegates(), clonedGame);
@@ -154,7 +164,7 @@ export class PlayerKillerService {
private applyPlayerAttributesDeathOutcomes(killedPlayer: Player, game: Game): Game {
let clonedGame = createGame(game);
let clonedKilledPlayer = createPlayer(killedPlayer);
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("applyPlayerAttributesDeathOutcomes", { gameId: game._id, playerId: killedPlayer._id });
+ const cantFindPlayerException = createCantFindPlayerWithIdUnexpectedException("applyPlayerAttributesDeathOutcomes", { gameId: game._id, playerId: killedPlayer._id });
if (doesPlayerHaveActiveAttributeWithName(killedPlayer, PlayerAttributeNames.SHERIFF, clonedGame)) {
clonedGame = this.applySheriffPlayerDeathOutcomes(clonedKilledPlayer, clonedGame);
clonedKilledPlayer = getPlayerWithIdOrThrow(clonedKilledPlayer._id, clonedGame, cantFindPlayerException);
@@ -181,8 +191,9 @@ export class PlayerKillerService {
return addPlayerAttributeInGame(bigBadWolfPlayer._id, clonedGame, createPowerlessByWerewolvesPlayerAttribute());
}
- private applyRustySwordKnightDeathOutcomes(killedPlayer: Player, game: Game, death: PlayerDeath): Game {
+ private applyRustySwordKnightDeathOutcomes(killedPlayer: DeadPlayer, game: Game): Game {
const clonedGame = createGame(game);
+ const { death } = killedPlayer;
const leftAliveWerewolfNeighbor = getNearestAliveNeighbor(killedPlayer._id, clonedGame, { direction: "left", playerSide: RoleSides.WEREWOLVES });
if (killedPlayer.role.current !== RoleNames.RUSTY_SWORD_KNIGHT || !isPlayerPowerful(killedPlayer, clonedGame) ||
death.cause !== PlayerDeathCauses.EATEN || !leftAliveWerewolfNeighbor) {
@@ -191,16 +202,18 @@ export class PlayerKillerService {
return addPlayerAttributeInGame(leftAliveWerewolfNeighbor._id, clonedGame, createContaminatedByRustySwordKnightPlayerAttribute());
}
- private applyScapegoatDeathOutcomes(killedPlayer: Player, game: Game, death: PlayerDeath): Game {
+ private applyScapegoatDeathOutcomes(killedPlayer: DeadPlayer, game: Game): Game {
const clonedGame = createGame(game);
+ const { death } = killedPlayer;
if (killedPlayer.role.current !== RoleNames.SCAPEGOAT || !isPlayerPowerful(killedPlayer, clonedGame) || death.cause !== PlayerDeathCauses.VOTE_SCAPEGOATED) {
return clonedGame;
}
return prependUpcomingPlayInGame(createGamePlayScapegoatBansVoting(), clonedGame);
}
- private applyElderDeathOutcomes(killedPlayer: Player, game: Game, death: PlayerDeath): Game {
+ private applyElderDeathOutcomes(killedPlayer: DeadPlayer, game: Game): Game {
let clonedGame = createGame(game);
+ const { death } = killedPlayer;
const elderRevengeDeathCauses: PlayerDeathCauses[] = [PlayerDeathCauses.VOTE, PlayerDeathCauses.SHOT, PlayerDeathCauses.DEATH_POTION];
const { idiot: idiotOptions, elder: elderOptions } = clonedGame.options.roles;
if (killedPlayer.role.current !== RoleNames.ELDER || !isPlayerPowerful(killedPlayer, game)) {
@@ -225,55 +238,38 @@ export class PlayerKillerService {
return prependUpcomingPlayInGame(createGamePlayHunterShoots(), clonedGame);
}
- private applyPlayerRoleDeathOutcomes(killedPlayer: Player, game: Game, death: PlayerDeath): Game {
+ private applyPlayerRoleDeathOutcomes(killedPlayer: DeadPlayer, game: Game): Game {
const clonedGame = createGame(game);
- if (killedPlayer.role.current === RoleNames.HUNTER) {
- return this.applyHunterDeathOutcomes(killedPlayer, clonedGame);
- }
- if (killedPlayer.role.current === RoleNames.ELDER) {
- return this.applyElderDeathOutcomes(killedPlayer, clonedGame, death);
- }
- if (killedPlayer.role.current === RoleNames.SCAPEGOAT) {
- return this.applyScapegoatDeathOutcomes(killedPlayer, clonedGame, death);
- }
- if (killedPlayer.role.current === RoleNames.RUSTY_SWORD_KNIGHT) {
- return this.applyRustySwordKnightDeathOutcomes(killedPlayer, clonedGame, death);
- }
- return clonedGame;
- }
-
- private applyPlayerDeathOutcomes(killedPlayer: Player, game: Game, death: PlayerDeath): Game {
- let clonedGame = createGame(game);
- let clonedPlayerToKill = createPlayer(killedPlayer);
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("applyPlayerDeathOutcomes", { gameId: game._id, playerId: killedPlayer._id });
- clonedGame = this.applyPlayerRoleDeathOutcomes(clonedPlayerToKill, clonedGame, death);
- clonedGame = this.applyPlayerSideDeathOutcomes(clonedPlayerToKill, clonedGame);
- clonedPlayerToKill = getPlayerWithIdOrThrow(clonedPlayerToKill._id, clonedGame, cantFindPlayerException);
- clonedGame = this.applyPlayerAttributesDeathOutcomes(clonedPlayerToKill, clonedGame);
- if (!doesGameHaveCurrentOrUpcomingPlaySourceAndAction(clonedGame, PlayerGroups.SURVIVORS, GamePlayActions.BURY_DEAD_BODIES)) {
- clonedGame = prependUpcomingPlayInGame(createGamePlaySurvivorsBuryDeadBodies(), clonedGame);
+ const roleDeathOutcomesMethods: Partial Game>> = {
+ [RoleNames.HUNTER]: () => this.applyHunterDeathOutcomes(killedPlayer, clonedGame),
+ [RoleNames.ELDER]: () => this.applyElderDeathOutcomes(killedPlayer, clonedGame),
+ [RoleNames.SCAPEGOAT]: () => this.applyScapegoatDeathOutcomes(killedPlayer, clonedGame),
+ [RoleNames.RUSTY_SWORD_KNIGHT]: () => this.applyRustySwordKnightDeathOutcomes(killedPlayer, clonedGame),
+ };
+ const roleDeathOutcomesMethod = roleDeathOutcomesMethods[killedPlayer.role.current];
+ if (roleDeathOutcomesMethod) {
+ return roleDeathOutcomesMethod(killedPlayer, clonedGame);
}
return clonedGame;
}
private killPlayer(playerToKill: Player, game: Game, death: PlayerDeath): Game {
let clonedGame = createGame(game);
- let clonedPlayerToKill = createPlayer(playerToKill);
- const cantFindPlayerException = createCantFindPlayerUnexpectedException("killPlayer", { gameId: game._id, playerId: playerToKill._id });
+ const clonedPlayerToKill = createPlayer(playerToKill);
clonedPlayerToKill.isAlive = false;
clonedPlayerToKill.death = createPlayerDeath(death);
clonedGame = updatePlayerInGame(clonedPlayerToKill._id, clonedPlayerToKill, clonedGame);
- clonedPlayerToKill = getPlayerWithIdOrThrow(clonedPlayerToKill._id, clonedGame, cantFindPlayerException);
- clonedGame = this.applyPlayerDeathOutcomes(clonedPlayerToKill, clonedGame, death);
- clonedPlayerToKill = getPlayerWithIdOrThrow(clonedPlayerToKill._id, clonedGame, cantFindPlayerException);
- return updatePlayerInGame(clonedPlayerToKill._id, this.removePlayerAttributesAfterDeath(clonedPlayerToKill), clonedGame);
+ if (!doesGameHaveUpcomingPlaySourceAndAction(clonedGame, PlayerGroups.SURVIVORS, GamePlayActions.BURY_DEAD_BODIES)) {
+ clonedGame = prependUpcomingPlayInGame(createGamePlaySurvivorsBuryDeadBodies(), clonedGame);
+ }
+ return clonedGame;
}
- private getPlayerToKillInGame(playerId: Types.ObjectId, game: Game): Player {
+ private getPlayerToKillOrRevealInGame(playerId: Types.ObjectId, game: Game): Player {
const exceptionInterpolations = { gameId: game._id, playerId };
- const playerToKill = getPlayerWithIdOrThrow(playerId, game, createCantFindPlayerUnexpectedException("getPlayerToKillInGame", exceptionInterpolations));
+ const playerToKill = getPlayerWithIdOrThrow(playerId, game, createCantFindPlayerWithIdUnexpectedException("getPlayerToKillOrRevealInGame", exceptionInterpolations));
if (!playerToKill.isAlive) {
- throw createPlayerIsDeadUnexpectedException("getPlayerToKillInGame", exceptionInterpolations);
+ throw createPlayerIsDeadUnexpectedException("getPlayerToKillOrRevealInGame", exceptionInterpolations);
}
return playerToKill;
}
diff --git a/src/modules/game/schemas/game-history-record/game-history-record.schema.constant.ts b/src/modules/game/schemas/game-history-record/game-history-record.schema.constant.ts
index 7a0d05bb9..fc47e1a95 100644
--- a/src/modules/game/schemas/game-history-record/game-history-record.schema.constant.ts
+++ b/src/modules/game/schemas/game-history-record/game-history-record.schema.constant.ts
@@ -2,6 +2,7 @@ import type { ApiPropertyOptions } from "@nestjs/swagger";
import { SchemaTypes } from "mongoose";
import type { ReadonlyDeep } from "type-fest";
+import { DEAD_PLAYER_SCHEMA } from "@/modules/game/schemas/player/dead-player.schema";
import { PLAYER_SCHEMA } from "@/modules/game/schemas/player/player.schema";
import { GAME_HISTORY_RECORD_PLAY_SCHEMA } from "@/modules/game/schemas/game-history-record/game-history-record-play/game-history-record-play.schema";
import { GamePhases } from "@/modules/game/enums/game.enum";
@@ -39,7 +40,7 @@ const GAME_HISTORY_RECORD_FIELDS_SPECS = {
},
deadPlayers: {
required: false,
- type: [PLAYER_SCHEMA],
+ type: [DEAD_PLAYER_SCHEMA],
default: undefined,
},
createdAt: { required: true },
diff --git a/src/modules/game/schemas/game-history-record/game-history-record.schema.ts b/src/modules/game/schemas/game-history-record/game-history-record.schema.ts
index 6ef10b4ba..a26ad898f 100644
--- a/src/modules/game/schemas/game-history-record/game-history-record.schema.ts
+++ b/src/modules/game/schemas/game-history-record/game-history-record.schema.ts
@@ -4,6 +4,7 @@ import { ApiProperty } from "@nestjs/swagger";
import { Expose, Transform, Type } from "class-transformer";
import { Types } from "mongoose";
+import { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
import { GAME_HISTORY_RECORD_API_PROPERTIES, GAME_HISTORY_RECORD_FIELDS_SPECS } from "@/modules/game/schemas/game-history-record/game-history-record.schema.constant";
import { GamePhases } from "@/modules/game/enums/game.enum";
import { GameHistoryRecordPlay } from "@/modules/game/schemas/game-history-record/game-history-record-play/game-history-record-play.schema";
@@ -59,9 +60,9 @@ class GameHistoryRecord {
@ApiProperty(GAME_HISTORY_RECORD_API_PROPERTIES.deadPlayers as ApiPropertyOptions)
@Prop(GAME_HISTORY_RECORD_FIELDS_SPECS.deadPlayers)
- @Type(() => Player)
+ @Type(() => DeadPlayer)
@Expose()
- public deadPlayers?: Player[];
+ public deadPlayers?: DeadPlayer[];
@ApiProperty(GAME_HISTORY_RECORD_API_PROPERTIES.createdAt as ApiPropertyOptions)
@Type(() => Date)
diff --git a/src/modules/game/schemas/player/dead-player.schema.ts b/src/modules/game/schemas/player/dead-player.schema.ts
new file mode 100644
index 000000000..3bcc40698
--- /dev/null
+++ b/src/modules/game/schemas/player/dead-player.schema.ts
@@ -0,0 +1,32 @@
+import { Prop, Schema, SchemaFactory } from "@nestjs/mongoose";
+import type { ApiPropertyOptions } from "@nestjs/swagger";
+import { ApiProperty } from "@nestjs/swagger";
+import { Expose, Type } from "class-transformer";
+
+import { Player } from "@/modules/game/schemas/player/player.schema";
+import { PLAYER_API_PROPERTIES, PLAYER_FIELDS_SPECS } from "@/modules/game/schemas/player/player.schema.constant";
+import { PlayerDeath } from "@/modules/game/schemas/player/player-death/player-death.schema";
+
+@Schema({ versionKey: false })
+class DeadPlayer extends Player {
+ @ApiProperty(PLAYER_API_PROPERTIES.isAlive as ApiPropertyOptions)
+ @Prop(PLAYER_FIELDS_SPECS.isAlive)
+ @Expose()
+ declare public isAlive: false;
+
+ @ApiProperty(PLAYER_API_PROPERTIES.death as ApiPropertyOptions)
+ @Prop({
+ ...PLAYER_FIELDS_SPECS.death,
+ required: true,
+ })
+ @Type(() => PlayerDeath)
+ @Expose()
+ declare public death: PlayerDeath;
+}
+
+const DEAD_PLAYER_SCHEMA = SchemaFactory.createForClass(DeadPlayer);
+
+export {
+ DeadPlayer,
+ DEAD_PLAYER_SCHEMA,
+};
\ No newline at end of file
diff --git a/src/modules/role/constants/role.constant.ts b/src/modules/role/constants/role.constant.ts
index 67aa6a848..841d23eb4 100644
--- a/src/modules/role/constants/role.constant.ts
+++ b/src/modules/role/constants/role.constant.ts
@@ -251,6 +251,14 @@ const VILLAGER_ROLES: ReadonlyDeep = plainToInstance(Role, [
maxInGame: 1,
recommendedMinPlayers: 8,
},
+ {
+ name: RoleNames.DEVOTED_SERVANT,
+ side: RoleSides.VILLAGERS,
+ type: RoleTypes.VILLAGER,
+ origin: RoleOrigins.CHARACTERS,
+ additionalCardsEligibleRecipients: [RoleNames.THIEF],
+ maxInGame: 1,
+ },
]);
const ROLES: ReadonlyDeep = plainToInstance(Role, [
diff --git a/src/modules/role/enums/role.enum.ts b/src/modules/role/enums/role.enum.ts
index 92f55f134..650d557f8 100644
--- a/src/modules/role/enums/role.enum.ts
+++ b/src/modules/role/enums/role.enum.ts
@@ -28,6 +28,7 @@ enum RoleNames {
SCANDALMONGER = "scandalmonger",
PREJUDICED_MANIPULATOR = "prejudiced-manipulator",
ACTOR = "actor",
+ DEVOTED_SERVANT = "devoted-servant",
}
enum RoleSides {
diff --git a/src/shared/exception/enums/bad-game-play-payload-error.enum.ts b/src/shared/exception/enums/bad-game-play-payload-error.enum.ts
index 1362b802d..e0bea5465 100644
--- a/src/shared/exception/enums/bad-game-play-payload-error.enum.ts
+++ b/src/shared/exception/enums/bad-game-play-payload-error.enum.ts
@@ -37,6 +37,8 @@ enum BadGamePlayPayloadReasons {
BAD_DEFENDER_TARGET = "Defender can't protect this target",
BAD_SHERIFF_DELEGATE_TARGET = "Sheriff can't delegate his role to this target",
BAD_SHERIFF_SETTLE_VOTES_TARGET = "Sheriff can't break the tie in votes with this target",
+ DEVOTED_SERVANT_CANT_STEAL_ROLE = "Devoted servant can't steal the role of this target because she's not in the game or dead or powerless or in love with another player",
+ BAD_DEVOTED_SERVANT_TARGET = "Devoted servant can't steal the role of this target because he's not about to be buried",
}
export { BadGamePlayPayloadReasons };
\ No newline at end of file
diff --git a/src/shared/exception/enums/unexpected-exception.enum.ts b/src/shared/exception/enums/unexpected-exception.enum.ts
index 624c74668..4884e675f 100644
--- a/src/shared/exception/enums/unexpected-exception.enum.ts
+++ b/src/shared/exception/enums/unexpected-exception.enum.ts
@@ -1,11 +1,13 @@
enum UnexpectedExceptionReasons {
CANT_FIND_PLAYER_WITH_ID_IN_GAME = `Can't find player with id "{{playerId}}" for game with id "{{gameId}}"`,
+ CANT_FIND_PLAYER_WITH_CURRENT_ROLE_IN_GAME = `Can't find player with role "{{roleName}}" for game with id "{{gameId}}"`,
PLAYER_IS_DEAD = `Player with id "{{playerId}}" is dead in game with id "{{gameId}}"`,
CANT_GENERATE_GAME_PLAYS = `Can't generate game plays`,
NO_CURRENT_GAME_PLAY = `Game with id "{{gameId}}" doesn't have a current game play to deal with`,
NO_GAME_PLAY_PRIORITY = `Game play "{{gamePlay}}" doesn't have a set priority`,
MALFORMED_CURRENT_GAME_PLAY = `Current game play with action "{{action}}" and source "{{source}}" are not consistent for game with id "{{gameId}}"`,
CANT_FIND_LAST_NOMINATED_PLAYERS = `Can't find last nominated players for game with id "{{gameId}}"`,
+ CANT_FIND_LAST_DEAD_PLAYERS = `Can't find last dead players for game with id "{{gameId}}"`,
}
export { UnexpectedExceptionReasons };
\ No newline at end of file
diff --git a/src/shared/exception/helpers/unexpected-exception.factory.ts b/src/shared/exception/helpers/unexpected-exception.factory.ts
index 3a77acc7f..df995d6ed 100644
--- a/src/shared/exception/helpers/unexpected-exception.factory.ts
+++ b/src/shared/exception/helpers/unexpected-exception.factory.ts
@@ -1,15 +1,21 @@
import type { Types } from "mongoose";
+import type { RoleNames } from "@/modules/role/enums/role.enum";
import type { GamePlay } from "@/modules/game/schemas/game-play/game-play.schema";
import { UnexpectedExceptionReasons } from "@/shared/exception/enums/unexpected-exception.enum";
import { UnexpectedException } from "@/shared/exception/types/unexpected-exception.type";
-function createCantFindPlayerUnexpectedException(scope: string, interpolations: { gameId: Types.ObjectId; playerId: Types.ObjectId }): UnexpectedException {
+function createCantFindPlayerWithIdUnexpectedException(scope: string, interpolations: { gameId: Types.ObjectId; playerId: Types.ObjectId }): UnexpectedException {
const { gameId, playerId } = interpolations;
return new UnexpectedException(scope, UnexpectedExceptionReasons.CANT_FIND_PLAYER_WITH_ID_IN_GAME, { gameId: gameId.toString(), playerId: playerId.toString() });
}
+function createCantFindPlayerWithCurrentRoleUnexpectedException(scope: string, interpolations: { gameId: Types.ObjectId; roleName: RoleNames }): UnexpectedException {
+ const { gameId, roleName } = interpolations;
+ return new UnexpectedException(scope, UnexpectedExceptionReasons.CANT_FIND_PLAYER_WITH_CURRENT_ROLE_IN_GAME, { gameId: gameId.toString(), roleName });
+}
+
function createPlayerIsDeadUnexpectedException(scope: string, interpolations: { gameId: Types.ObjectId; playerId: Types.ObjectId }): UnexpectedException {
const { gameId, playerId } = interpolations;
return new UnexpectedException(scope, UnexpectedExceptionReasons.PLAYER_IS_DEAD, { gameId: gameId.toString(), playerId: playerId.toString() });
@@ -38,12 +44,19 @@ function createCantFindLastNominatedPlayersUnexpectedException(scope: string, in
return new UnexpectedException(scope, UnexpectedExceptionReasons.CANT_FIND_LAST_NOMINATED_PLAYERS, { gameId: gameId.toString() });
}
+function createCantFindLastDeadPlayersUnexpectedException(scope: string, interpolations: { gameId: Types.ObjectId }): UnexpectedException {
+ const { gameId } = interpolations;
+ return new UnexpectedException(scope, UnexpectedExceptionReasons.CANT_FIND_LAST_DEAD_PLAYERS, { gameId: gameId.toString() });
+}
+
export {
- createCantFindPlayerUnexpectedException,
+ createCantFindPlayerWithIdUnexpectedException,
+ createCantFindPlayerWithCurrentRoleUnexpectedException,
createPlayerIsDeadUnexpectedException,
createCantGenerateGamePlaysUnexpectedException,
createNoCurrentGamePlayUnexpectedException,
createNoGamePlayPriorityUnexpectedException,
createMalformedCurrentGamePlayUnexpectedException,
createCantFindLastNominatedPlayersUnexpectedException,
+ createCantFindLastDeadPlayersUnexpectedException,
};
\ No newline at end of file
diff --git a/tests/acceptance/features/game/features/crud/game-creation.feature b/tests/acceptance/features/game/features/crud/game-creation.feature
index 920b0f4f3..b4c848b9b 100644
--- a/tests/acceptance/features/game/features/crud/game-creation.feature
+++ b/tests/acceptance/features/game/features/crud/game-creation.feature
@@ -157,8 +157,8 @@ Feature: 🎲 Game Creation
And the request exception status code should be 400
And the request exception error should be "Bad Request"
And the request exception messages should be
- | message |
- | players.4.role.name must be one of the following values: werewolf, big-bad-wolf, accursed-wolf-father, white-werewolf, villager, villager-villager, seer, cupid, witch, hunter, little-girl, defender, elder, scapegoat, idiot, two-sisters, three-brothers, fox, bear-tamer, stuttering-judge, rusty-sword-knight, thief, wild-child, wolf-hound, angel, pied-piper, scandalmonger, prejudiced-manipulator, actor |
+ | message |
+ | players.4.role.name must be one of the following values: werewolf, big-bad-wolf, accursed-wolf-father, white-werewolf, villager, villager-villager, seer, cupid, witch, hunter, little-girl, defender, elder, scapegoat, idiot, two-sisters, three-brothers, fox, bear-tamer, stuttering-judge, rusty-sword-knight, thief, wild-child, wolf-hound, angel, pied-piper, scandalmonger, prejudiced-manipulator, actor, devoted-servant |
Scenario: 🎲 Game can't be created if there is only one of the two sisters
@@ -477,8 +477,8 @@ Feature: 🎲 Game Creation
And the request exception status code should be 400
And the request exception error should be "Bad Request"
And the request exception messages should be
- | message |
- | additionalCards.roleName for thief must be one of the following values: werewolf,big-bad-wolf,accursed-wolf-father,white-werewolf,villager,villager-villager,seer,cupid,witch,hunter,little-girl,defender,elder,scapegoat,idiot,fox,bear-tamer,stuttering-judge,rusty-sword-knight,wild-child,wolf-hound,angel,pied-piper,scandalmonger,prejudiced-manipulator |
+ | message |
+ | additionalCards.roleName for thief must be one of the following values: werewolf,big-bad-wolf,accursed-wolf-father,white-werewolf,villager,villager-villager,seer,cupid,witch,hunter,little-girl,defender,elder,scapegoat,idiot,fox,bear-tamer,stuttering-judge,rusty-sword-knight,wild-child,wolf-hound,angel,pied-piper,scandalmonger,prejudiced-manipulator,devoted-servant |
Scenario: 🎲 Game can't be created if there are two wild children
@@ -751,4 +751,19 @@ Feature: 🎲 Game Creation
And the request exception error should be "Bad Request"
And the request exception messages should be
| message |
- | additionalCards.roleName for actor must be one of the following values: seer,cupid,witch,hunter,little-girl,defender,elder,scapegoat,idiot,fox,bear-tamer,stuttering-judge,rusty-sword-knight,wild-child,wolf-hound,angel,pied-piper,scandalmonger |
\ No newline at end of file
+ | additionalCards.roleName for actor must be one of the following values: seer,cupid,witch,hunter,little-girl,defender,elder,scapegoat,idiot,fox,bear-tamer,stuttering-judge,rusty-sword-knight,wild-child,wolf-hound,angel,pied-piper,scandalmonger |
+
+ Scenario: 🎲 Game can't be created if there are two devoted servants
+
+ Given a created game with the following players
+ | name | role |
+ | Antoine | devoted-servant |
+ | Olivia | devoted-servant |
+ | JB | idiot |
+ | Thomas | werewolf |
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception error should be "Bad Request"
+ And the request exception messages should be
+ | message |
+ | players.role can't exceed role maximum occurrences in game. Please check `maxInGame` property of roles |
\ No newline at end of file
diff --git a/tests/acceptance/features/game/features/game-history/game-history.feature b/tests/acceptance/features/game/features/game-history/game-history.feature
index d0e2418aa..ba4e9f0cd 100644
--- a/tests/acceptance/features/game/features/game-history/game-history.feature
+++ b/tests/acceptance/features/game/features/game-history/game-history.feature
@@ -551,7 +551,14 @@ Feature: 📜 Game History
| name | vote |
| Antoine | JB |
And the most recent history record is retrieved
+ Then the dead players from the previous history record should be the following players
+ | name |
+ | JB |
+
+ When the survivors bury dead bodies
+ And the most recent history record is retrieved
Then the dead players from the previous history record should be the following players
| name |
- | JB |
- | Thomas |
\ No newline at end of file
+ | Thomas |
+
+ # TODO: complete this scenario with multiple dead players at the same time (add witch for example)
\ No newline at end of file
diff --git a/tests/acceptance/features/game/features/game-play/vote.feature b/tests/acceptance/features/game/features/game-play/vote.feature
index 21f796584..6105e0383 100644
--- a/tests/acceptance/features/game/features/game-play/vote.feature
+++ b/tests/acceptance/features/game/features/game-play/vote.feature
@@ -88,6 +88,8 @@ Feature: 🗳️ Vote Game Play
When the werewolves eat the player named Olivia
Then the player named Olivia should be murdered by werewolves from eaten
And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
When the survivors bury dead bodies
Then the game's current play should be survivors to vote
diff --git a/tests/acceptance/features/game/features/role/accursed-wolf-father.feature b/tests/acceptance/features/game/features/role/accursed-wolf-father.feature
index ffe12db48..6195f3919 100644
--- a/tests/acceptance/features/game/features/role/accursed-wolf-father.feature
+++ b/tests/acceptance/features/game/features/role/accursed-wolf-father.feature
@@ -85,6 +85,8 @@ Feature: 🐺 Accursed Wolf-Father role
| voter | against |
| Olivia | Antoine |
Then the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
When the survivors bury dead bodies
Then the game's current play should be werewolves to eat
diff --git a/tests/acceptance/features/game/features/role/actor.feature b/tests/acceptance/features/game/features/role/actor.feature
index e90e6997f..bef935577 100644
--- a/tests/acceptance/features/game/features/role/actor.feature
+++ b/tests/acceptance/features/game/features/role/actor.feature
@@ -25,6 +25,7 @@ Feature: 🎭 Actor role
When the actor chooses card with role seer
Then the request should have succeeded with status code 200
+ And the player named Antoine should have the active acting from actor attribute
And the player named Antoine should be currently a seer and originally a actor
And the game's additional card with role seer for actor should be used
And the game's current play should be seer to look
@@ -43,10 +44,12 @@ Feature: 🎭 Actor role
When the player or group skips his turn
Then the player named Antoine should be currently a actor and originally a actor
+ And the player named Antoine should not have the active acting from actor attribute
And the game's current play should be actor to choose-card
When the actor chooses card with role witch
Then the player named Antoine should be currently a witch and originally a actor
+ And the player named Antoine should have the active acting from actor attribute
And the game's additional card with role witch for actor should be used
And the game's current play should be werewolves to eat
@@ -67,6 +70,7 @@ Feature: 🎭 Actor role
When the player or group skips his turn
Then the request should have succeeded with status code 200
And the player named Antoine should be currently a actor and originally a actor
+ And the player named Antoine should not have the active acting from actor attribute
And the game's additional card with role little-girl for actor should not be used
And the game's current play should be werewolves to eat
@@ -93,6 +97,7 @@ Feature: 🎭 Actor role
When the player or group skips his turn
Then the player named Antoine should be currently a actor and originally a actor
+ And the player named Antoine should not have the active acting from actor attribute
And the game's current play should be werewolves to eat
Scenario: 🎭 Actor can't choose an unknown card
@@ -211,7 +216,13 @@ Feature: 🎭 Actor role
When the werewolves eat the player named Louise
Then the game's current play should be survivors to bury-dead-bodies
And the player named Louise should be murdered by werewolves from eaten
- And the player named Thomas should be murdered by cupid from broken-heart
+ And the player named Thomas should be alive
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
+
+ When the survivors bury dead bodies
+ Then the player named Thomas should be murdered by cupid from broken-heart
+ And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
Then the game's current play should be survivors to vote
@@ -378,12 +389,13 @@ Feature: 🎭 Actor role
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
- And the player named JB should have the active contaminated from rusty-sword-knight attribute
+ And the player named JB should not have the active contaminated from rusty-sword-knight attribute
And the player named JB should be alive
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ Then the player named JB should have the active contaminated from rusty-sword-knight attribute
+ And the game's current play should be survivors to vote
When the player or group skips his turn
Then the player named JB should be murdered by rusty-sword-knight from disease
@@ -441,12 +453,14 @@ Feature: 🎭 Actor role
When the werewolves eat the player named Olivia
Then the player named Olivia should be murdered by werewolves from eaten
- And the player named Antoine should be on werewolves current side and originally be on villagers side
- And the player named Antoine should have the active powerless from actor attribute
+ And the player named Antoine should be on villagers current side and originally be on villagers side
+ And the player named Antoine should not have the active powerless from actor attribute
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ Then the player named Antoine should be on werewolves current side and originally be on villagers side
+ And the player named Antoine should have the active powerless from actor attribute
+ And the game's current play should be survivors to vote
When the player or group skips his turn
Then the game's current play should be werewolves to eat
@@ -476,12 +490,14 @@ Feature: 🎭 Actor role
When the werewolves eat the player named Olivia
Then the player named Olivia should be murdered by werewolves from eaten
- And the player named Antoine should be on werewolves current side and originally be on villagers side
+ And the player named Antoine should be on villagers current side and originally be on villagers side
And the player named Antoine should not have the active powerless from actor attribute
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ Then the player named Antoine should be on werewolves current side and originally be on villagers side
+ And the player named Antoine should not have the active powerless from actor attribute
+ And the game's current play should be survivors to vote
When the player or group skips his turn
Then the game's current play should be actor to choose-card
diff --git a/tests/acceptance/features/game/features/role/angel.feature b/tests/acceptance/features/game/features/role/angel.feature
index ab7ed86bb..083cd704c 100644
--- a/tests/acceptance/features/game/features/role/angel.feature
+++ b/tests/acceptance/features/game/features/role/angel.feature
@@ -45,14 +45,14 @@ Feature: 👼 Angel role
| Antoine | Olivia |
| JB | Olivia |
Then the player named Olivia should be murdered by survivors from vote
- And 2 of the following players should have the active powerless from elder attribute
- | name |
- | Antoine |
- | JB |
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be werewolves to eat
+ Then 2 of the following players should have the active powerless from elder attribute
+ | name |
+ | Antoine |
+ | JB |
+ And the game's current play should be werewolves to eat
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
diff --git a/tests/acceptance/features/game/features/role/big-bad-wolf.feature b/tests/acceptance/features/game/features/role/big-bad-wolf.feature
index 4bb8d76e3..bd039b71b 100644
--- a/tests/acceptance/features/game/features/role/big-bad-wolf.feature
+++ b/tests/acceptance/features/game/features/role/big-bad-wolf.feature
@@ -55,11 +55,12 @@ Feature: 🐺👹 Big Bad Wolf role
| Olivia | JB |
| Thomas | JB |
Then the player named JB should be murdered by survivors from vote
- And the player named Olivia should have the active powerless from werewolves attribute
+ And the player named Olivia should not have the active powerless from werewolves attribute
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be seer to look
+ Then the player named Olivia should have the active powerless from werewolves attribute
+ And the game's current play should be seer to look
When the seer looks at the player named Olivia
Then the player named Olivia should have the active seen from seer attribute
@@ -218,7 +219,7 @@ Feature: 🐺👹 Big Bad Wolf role
And the request exception message should be "Bad game play payload"
And the request exception error should be "There are too much targets for this current game's state"
- Scenario: 🐺👹Big Bad Wolf eats every night and not powerless if one werewolf dies
+ Scenario: 🐺👹Big Bad Wolf eats every night and not powerless if one werewolf dies with right option
Given a created game with options described in file no-sheriff-option.json, big-bad-wolf-not-powerless-if-werewolf-dies-option.json and with the following players
| name | role |
@@ -263,7 +264,8 @@ Feature: 🐺👹 Big Bad Wolf role
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be seer to look
+ Then the player named Olivia should not have the active powerless from werewolves attribute
+ And the game's current play should be seer to look
When the seer looks at the player named Olivia
Then the player named Olivia should have the active seen from seer attribute
diff --git a/tests/acceptance/features/game/features/role/cupid.feature b/tests/acceptance/features/game/features/role/cupid.feature
index 15478ea89..a7456c3c0 100644
--- a/tests/acceptance/features/game/features/role/cupid.feature
+++ b/tests/acceptance/features/game/features/role/cupid.feature
@@ -72,7 +72,11 @@ Feature: 💘 Cupid role
| Olivia | JB |
| Thomas | JB |
Then the player named JB should be murdered by survivors from vote
- And the player named Thomas should be murdered by cupid from broken-heart
+ And the player named Thomas should be alive
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Thomas should be murdered by cupid from broken-heart
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
diff --git a/tests/acceptance/features/game/features/role/devoted-servant.feature b/tests/acceptance/features/game/features/role/devoted-servant.feature
new file mode 100644
index 000000000..b8b5fed7c
--- /dev/null
+++ b/tests/acceptance/features/game/features/role/devoted-servant.feature
@@ -0,0 +1,1269 @@
+@devoted-servant-role
+
+Feature: 🎀 Devoted Servant role
+
+ Scenario: 🎀 Devoted servant steals the role of the seer and can look each night
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | seer |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the request should have succeeded with status code 201
+ And the game's current play should be seer to look
+ And the game's current play should be played by the following players
+ | name |
+ | Olivia |
+
+ When the seer looks at the player named Antoine
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play can be skipped
+ And the game's current play occurrence should be consequential
+ And the game's current play should have eligible targets boundaries from 0 to 1
+ And the game's current play should have the following eligible targets interactable players
+ | name |
+ | Olivia |
+ And the game's current play eligible targets interactable player named Olivia should have the following interactions
+ | source | interaction |
+ | devoted-servant | steal-role |
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should have the active stolen-role from devoted-servant attribute
+ And the player named Olivia should be currently a devoted-servant and originally a seer
+ And the player named JB should be currently a seer and originally a devoted-servant
+ And the player named Olivia should have his role revealed
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be seer to look
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted servant can't steal the role if she is dead
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | angel |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be survivors to vote because angel-presence
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Olivia | JB |
+ Then the player named JB should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play can be skipped
+ And the game's current play should not have eligible targets
+
+ When the devoted servant steals the role of the player named JB
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "Devoted servant can't steal the role of this target because she's not in the game or dead or powerless or in love with another player"
+
+ Scenario: 🎀 Devoted servant can't steal the role if she is powerless
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | angel |
+ | JB | devoted-servant |
+ | Thomas | elder |
+ | Juju | villager |
+ Then the game's current play should be survivors to vote because angel-presence
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Olivia | Thomas |
+ Then the player named Thomas should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Juju
+ Then the player named Juju should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play can be skipped
+ And the game's current play should not have eligible targets
+
+ When the devoted servant steals the role of the player named Juju
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "Devoted servant can't steal the role of this target because she's not in the game or dead or powerless or in love with another player"
+
+ Scenario: 🎀 Devoted servant can't steal the role if she is in love
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | cupid |
+ Then the game's current play should be cupid to charm
+
+ When the cupid shoots an arrow at the player named JB and the player named Olivia
+ Then the game's current play should be lovers to meet-each-other
+
+ When the lovers meet each other
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play can be skipped
+ And the game's current play should not have eligible targets
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "Devoted servant can't steal the role of this target because she's not in the game or dead or powerless or in love with another player"
+
+ Scenario: 🎀 Devoted servant can't steal the role of an alive player
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "Devoted servant can't steal the role of this target because he's not about to be buried"
+
+ Scenario: 🎀 Devoted servant can't steal the role of a dead player who is not about to be buried
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ | Juju | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Olivia | Juju |
+ Then the player named Juju should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "Devoted servant can't steal the role of this target because he's not about to be buried"
+
+ Scenario: 🎀 Devoted servant can't steal the role of an unknown player
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the player or group targets an unknown player
+ Then the request should have failed with status code 404
+ And the request exception status code should be 404
+ And the request exception message should be "Player with id "4c1b96d4dfe5af0ddfa19e35" not found"
+ And the request exception error should be "Game Play - Player in `targets.player` is not in the game players"
+
+ Scenario: 🎀 Devoted servant can't steal the role of multiple about to be buried players
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ | Juju | witch |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the game's current play should be witch to use-potions
+
+ When the witch uses death potion on the player named Juju
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the player named Juju should be murdered by witch from death-potion
+ And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should have eligible targets boundaries from 0 to 1
+ And the game's current play should have the following eligible targets interactable players
+ | name |
+ | Thomas |
+ | Juju |
+ And the game's current play eligible targets interactable player named Thomas should have the following interactions
+ | source | interaction |
+ | devoted-servant | steal-role |
+ And the game's current play eligible targets interactable player named Juju should have the following interactions
+ | source | interaction |
+ | devoted-servant | steal-role |
+
+ When the player or group targets the following players
+ | target |
+ | Thomas |
+ | Juju |
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "There are too much targets for this current game's state"
+
+ Scenario: 🎀 Devoted servant must delegate if she was sheriff before stealing a role
+
+ Given a created game with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be survivors to elect-sheriff
+
+ When the survivors elect sheriff with the following votes
+ | voter | target |
+ | Olivia | JB |
+ Then the player named JB should have the active sheriff from survivors attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the player named Thomas should be currently a devoted-servant and originally a villager
+ And the player named JB should be currently a villager and originally a devoted-servant
+ And the player named Thomas should have his role revealed
+ And the player named JB should not have his role revealed
+ And the game's current play should be sheriff to delegate
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+ And the game's current play should have the following eligible targets interactable players
+ | name |
+ | Antoine |
+ | Olivia |
+ And the game's current play eligible targets interactable player named Antoine should have the following interactions
+ | source | interaction |
+ | sheriff | transfer-sheriff-role |
+ And the game's current play eligible targets interactable player named Olivia should have the following interactions
+ | source | interaction |
+ | sheriff | transfer-sheriff-role |
+
+ Scenario: 🎀 Devoted servant doesn't delegate if she was sheriff and steals the role of idiot
+
+ Given a created game with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | idiot |
+ Then the game's current play should be survivors to elect-sheriff
+
+ When the survivors elect sheriff with the following votes
+ | voter | target |
+ | Olivia | JB |
+ Then the player named JB should have the active sheriff from survivors attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the player named Thomas should be currently a devoted-servant and originally a idiot
+ And the player named JB should be currently a idiot and originally a devoted-servant
+ And the player named Thomas should have his role revealed
+ And the player named JB should not have his role revealed
+ And the player named JB should have the active sheriff from survivors attribute
+ And the game's current play should be survivors to vote
+
+ Scenario: 🎀 Devoted servant steals the role of the hunter before he dies so he doesn't shoot anybody
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | hunter |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the player named Thomas should be currently a devoted-servant and originally a hunter
+ And the player named Thomas should have his role revealed
+ And the player named JB should be currently a hunter and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ Scenario: 🎀 Devoted servant is not charmed by pied piper anymore if she steals a role
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | pied-piper |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the game's current play should be pied-piper to charm
+
+ When the pied piper charms the following players
+ | name |
+ | JB |
+ | Olivia |
+ Then the player named JB should have the active charmed from pied-piper attribute
+ And the player named Olivia should have the active charmed from pied-piper attribute
+ And the game's current play should be charmed to meet-each-other
+
+ When the charmed people meet each other
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a villager
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a villager and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the player named JB should not have the active charmed from pied-piper attribute
+
+ Scenario: 🎀 Devoted servant remains infected if she steals a role and so, as bear tamer, growls everyday
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | accursed-wolf-father |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | bear-tamer |
+ | Juju | villager |
+ | Mathilde | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the accursed wolf-father infects the player named JB
+ Then the player named JB should be on werewolves current side and originally be on villagers side
+ And the player named Thomas should have the active growled from bear-tamer attribute
+ And the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Mathilde | Thomas |
+ Then the player named Thomas should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the player named Thomas should be currently a devoted-servant and originally a bear-tamer
+ And the player named Thomas should be on villagers current side and originally be on villagers side
+ And the player named Thomas should have his role revealed
+ And the player named JB should be currently a bear-tamer and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the player named JB should be on werewolves current side and originally be on villagers side
+ And the game's current play should be werewolves to eat
+ And the game's current play should be played by the following players
+ | name |
+ | Antoine |
+ | JB |
+
+ When the werewolves eat the player named Juju
+ Then the player named Juju should be murdered by werewolves from eaten
+ And the player named JB should have the active growled from bear-tamer attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ Scenario: 🎀 Devoted Servant can protect whoever she wants as a defender, even the last target of the previous one
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Thomas | defender |
+ And the game's current play should be defender to protect
+
+ When the defender protects the player named JB
+ Then the player named JB should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the player named JB should not have the active protected from defender attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Thomas
+ Then the player named Thomas should be currently a devoted-servant and originally a defender
+ And the player named Thomas should have his role revealed
+ And the player named JB should be currently a defender and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named JB
+ Then the player named JB should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the player named JB should be alive
+ And the player named JB should not have the active protected from defender attribute
+ And the game's current play should be survivors to vote
+
+ Scenario: 🎀 Devoted Servant can infect again as the accursed wolf-father even if he already infected
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | accursed-wolf-father |
+ | Olivia | villager |
+ | JB | devoted-servant |
+ | Juju | villager |
+ | Mathilde | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the accursed wolf-father infects the player named Mathilde
+ Then the player named Mathilde should be on werewolves current side and originally be on villagers side
+ And the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Olivia | Antoine |
+ | Mathilde | Antoine |
+ Then the player named Antoine should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Antoine
+ Then the player named Antoine should be currently a devoted-servant and originally a accursed-wolf-father
+ And the player named Antoine should be on villagers current side and originally be on werewolves side
+ And the player named Antoine should have his role revealed
+ And the player named JB should be currently a accursed-wolf-father and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the player named JB should be on werewolves current side and originally be on villagers side
+ And the game's current play should be werewolves to eat
+
+ When the accursed wolf-father infects the player named Juju
+ Then the player named Juju should be on werewolves current side and originally be on villagers side
+ And the game's current play should be survivors to vote
+
+ Scenario: 🎀 Devoted Servant can use potions again as the witch even if she already used them
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | witch |
+ | JB | devoted-servant |
+ | Juju | villager |
+ | Mathilde | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the game's current play should be witch to use-potions
+
+ When the witch uses life potion on the player named JB and death potion on the player named Olivia
+ Then the player named Olivia should be murdered by witch from death-potion
+ And the player named JB should be alive
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a witch
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a witch and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the game's current play should be witch to use-potions
+
+ When the witch uses life potion on the player named JB and death potion on the player named Juju
+ Then the player named Juju should be murdered by witch from death-potion
+ And the player named JB should be alive
+ And the game's current play should be survivors to bury-dead-bodies
+
+ Scenario: 🎀 Devoted Servant can sniff as the fox even if he was powerless by himself before
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | fox |
+ | JB | devoted-servant |
+ | Juju | villager |
+ | Mathilde | villager |
+ Then the game's current play should be fox to sniff
+
+ When the fox sniffs the player named Juju
+ Then the player named Olivia should have the active powerless from fox attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a fox
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a fox and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be fox to sniff
+
+ Scenario: 🎀 Devoted Servant can choose another side as the wolf-hound
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | wolf-hound |
+ | JB | devoted-servant |
+ | Juju | villager |
+ Then the game's current play should be wolf-hound to choose-side
+
+ When the wolf-hound chooses the werewolves side
+ Then the player named Olivia should be on werewolves current side and originally be on villagers side
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Juju
+ Then the player named Juju should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | JB | Olivia |
+ Then the player named Olivia should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a wolf-hound
+ And the player named Olivia should be on villagers current side and originally be on villagers side
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a wolf-hound and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the game's current play should be wolf-hound to choose-side
+
+ When the wolf-hound chooses the werewolves side
+ Then the player named JB should be on werewolves current side and originally be on villagers side
+ And the game's current play should be werewolves to eat
+
+ Scenario: 🎀 Devoted Servant regains the original amount of lives against werewolves the elder had when stealing his role
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | elder |
+ | JB | devoted-servant |
+ | Juju | defender |
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named Olivia
+ Then the player named Olivia should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be alive
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named Juju
+ Then the player named Juju should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be alive
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named JB
+ Then the player named JB should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a elder
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a elder and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named Juju
+ Then the player named Juju should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the player named JB should be alive
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named Antoine
+ Then the player named Antoine should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the player named JB should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ Scenario: 🎀 Devoted Servant can ask for another judgement as the judge even if he already asked for one
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | stuttering-judge |
+ | JB | devoted-servant |
+ | Juju | villager |
+ | Mathilde | villager |
+ Then the game's current play should be stuttering-judge to choose-sign
+
+ When the stuttering judge chooses his sign
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Juju
+ Then the player named Juju should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes and the stuttering judge does his sign
+ | voter | target |
+ | Mathilde | Olivia |
+ Then the player named Olivia should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a stuttering-judge
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a stuttering-judge and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote because stuttering-judge-request
+
+ When the player or group skips his turn
+ Then the game's current play should be stuttering-judge to choose-sign
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ When the stuttering judge chooses his sign
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Mathilde
+ Then the player named Mathilde should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When nobody vote and the stuttering judge does his sign
+ Then the game's current play should be survivors to vote because stuttering-judge-request
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ Scenario: 🎀 Devoted Servant must choose another model as wild-child and the old one is then obsolete
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | wild-child |
+ | JB | devoted-servant |
+ | Juju | villager |
+ Then the game's current play should be wild-child to choose-model
+
+ When the wild child chooses the player named JB as a model
+ Then the player named JB should have the active worshiped from wild-child attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the player named JB should have the active worshiped from wild-child attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a wild-child
+ And the player named Olivia should have his role revealed
+ And the player named Olivia should be on villagers current side and originally be on villagers side
+ And the player named JB should be currently a wild-child and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should not have the active worshiped from wild-child attribute
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be wild-child to choose-model
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ When the wild child chooses the player named Juju as a model
+ Then the player named Juju should have the active worshiped from wild-child attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Juju
+ Then the player named Juju should be murdered by werewolves from eaten
+ And the player named Juju should have the active worshiped from wild-child attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named JB should not have the active worshiped from wild-child attribute
+ And the player named Juju should not have the active worshiped from wild-child attribute
+ And the player named JB should be on werewolves current side and originally be on villagers side
+
+ Scenario: 🎀 Devoted Servant is not powerless anymore if she steals the big bad wolf role and one wolf is dead
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | big-bad-wolf |
+ | JB | devoted-servant |
+ | Juju | defender |
+ | Doudou | witch |
+ Then the game's current play should be defender to protect
+
+ When the defender protects the player named Doudou
+ Then the player named Doudou should have the active protected from defender attribute
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Doudou
+ Then the player named Doudou should have the active eaten from werewolves attribute
+ And the game's current play should be big-bad-wolf to eat
+
+ When the big bad wolf eats the player named Juju
+ Then the game's current play should be witch to use-potions
+
+ When the witch uses death potion on the player named Antoine
+ Then the player named Antoine should be murdered by witch from death-potion
+ And the player named Juju should be murdered by big-bad-wolf from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Olivia should have the active powerless from werewolves attribute
+ And the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | JB | Olivia |
+ Then the player named Olivia should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a big-bad-wolf
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a big-bad-wolf and originally a devoted-servant
+ And the player named JB should be on werewolves current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the player named JB should not have the active powerless from big-bad-wolf attribute
+ And the game's current play should be werewolves to eat
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ When the werewolves eat the player named Doudou
+ Then the game's current play should be big-bad-wolf to eat
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted Servant prevents scapegoat to ban from votes by stealing his role
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | scapegoat |
+ | JB | devoted-servant |
+ | Juju | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Juju
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Antoine | JB |
+ | JB | Antoine |
+ Then the player named Olivia should be murdered by survivors from vote-scapegoated
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a scapegoat
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a scapegoat and originally a devoted-servant
+ And the player named JB should not have his role revealed
+ And the game's current play should be werewolves to eat
+
+ Scenario: 🎀 Devoted Servant steals the role of the white werewolf and wins
+
+ Given a created game with options described in files no-sheriff-option.json, white-werewolf-waking-up-every-night-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | white-werewolf |
+ | JB | devoted-servant |
+ | Juju | villager |
+ | Doudou | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Juju
+ Then the game's current play should be white-werewolf to eat
+
+ When the player or group skips his turn
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Antoine | Olivia |
+ Then the player named Olivia should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a white-werewolf
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a white-werewolf and originally a devoted-servant
+ And the player named JB should be on werewolves current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Doudou
+ Then the game's current play should be white-werewolf to eat
+
+ When the white werewolf eats the player named Antoine
+ Then the player named Antoine should be murdered by white-werewolf from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's status should be over
+ And the game's winners should be white-werewolf with the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted Servant steals the role of angel and wins
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | angel |
+ | JB | devoted-servant |
+ | Juju | hunter |
+ And the game's current play should be survivors to vote because angel-presence
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | Antoine | Juju |
+ Then the player named Juju should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be hunter to shoot
+
+ When the hunter shoots at the player named Olivia
+ Then the player named Olivia should be murdered by hunter from shot
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a angel
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a angel and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's status should be over
+ And the game's winners should be angel with the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted Servant steals the role of the pied piper and wins
+
+ Given a created game with options described in files no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | pied-piper |
+ | JB | devoted-servant |
+ | Juju | villager |
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the game's current play should be pied-piper to charm
+
+ When the pied piper charms the following players
+ | name |
+ | JB |
+ | Antoine |
+ Then the player named JB should have the active charmed from pied-piper attribute
+ And the player named Antoine should have the active charmed from pied-piper attribute
+ And the game's current play should be charmed to meet-each-other
+
+ When the charmed people meet each other
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a pied-piper
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a pied-piper and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the player named JB should not have the active charmed from pied-piper attribute
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the game's current play should be pied-piper to charm
+
+ When the pied piper charms the following players
+ | name |
+ | Juju |
+ Then the player named Juju should have the active charmed from pied-piper attribute
+ And the game's status should be over
+ And the game's winners should be pied-piper with the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted Servant steals the role of the prejudiced manipulator and wins
+
+ Given a created game with options described in file no-sheriff-option.json and with the following players
+ | name | role | group |
+ | Antoine | prejudiced-manipulator | boy |
+ | Olivia | werewolf | girl |
+ | JB | devoted-servant | girl |
+ | Thomas | villager | boy |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Antoine
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Antoine
+ Then the player named Antoine should be currently a devoted-servant and originally a prejudiced-manipulator
+ And the player named Antoine should have his role revealed
+ And the player named JB should be currently a prejudiced-manipulator and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | JB | Thomas |
+ Then the player named Thomas should be murdered by survivors from vote
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the player or group skips his turn
+ Then the game's status should be over
+ And the game's winners should be prejudiced-manipulator with the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted Servant will have her role revealed if she steals the role of villager-villager
+
+ Given a created game with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | villager-villager |
+ | JB | devoted-servant |
+ | Juju | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a villager-villager
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a villager-villager and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should have his role revealed
+
+ Scenario: 🎀 Devoted Servant prevents rusty sword knight to contaminate by stealing his role
+
+ Given a created game with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | rusty-sword-knight |
+ | JB | devoted-servant |
+ | Juju | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a rusty-sword-knight
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a rusty-sword-knight and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the player named Antoine should not have the active contaminated from rusty-sword-knight attribute
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named JB
+ Then the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Antoine should have the active contaminated from rusty-sword-knight attribute
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the player named Antoine should be murdered by rusty-sword-knight from disease
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's status should be over
+
+ Scenario: 🎀 Devoted Servant can choose between the thief cards if he didn't choose one
+
+ Given a created game with additional cards described in file seer-werewolf-additional-cards-for-thief.json and with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | thief |
+ | JB | devoted-servant |
+ | Juju | villager |
+ Then the game's current play should be thief to choose-card
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a thief
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a thief and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be thief to choose-card
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ When the thief chooses card with role seer
+ Then the player named JB should be currently a seer and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the game's current play should be seer to look
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ Scenario: 🎀 Devoted Servant doesn't charm other players if there are already some in love
+
+ Given a created game with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | werewolf |
+ | Olivia | cupid |
+ | JB | devoted-servant |
+ | Juju | villager |
+ And the game's current play should be cupid to charm
+
+ When the cupid shoots an arrow at the player named Antoine and the player named Juju
+ Then the player named Antoine should have the active in-love from cupid attribute
+ And the player named Juju should have the active in-love from cupid attribute
+ And the game's current play should be lovers to meet-each-other
+
+ When the lovers meet each other
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Olivia
+ Then the player named Olivia should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Olivia
+ Then the player named Olivia should be currently a devoted-servant and originally a cupid
+ And the player named Olivia should have his role revealed
+ And the player named JB should be currently a cupid and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should not have his role revealed
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ Scenario: 🎀 Devoted Servant steals the actor role if he didn't choose a card and thus can choose unused actor cards
+
+ Given a created game with additional cards described in file seer-witch-little-girl-additional-cards-for-actor.json and with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | actor |
+ | Olivia | werewolf |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be actor to choose-card
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Antoine
+ Then the player named Antoine should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Antoine
+ Then the player named Antoine should be currently a devoted-servant and originally a actor
+ And the player named Antoine should have his role revealed
+ And the player named JB should be currently a actor and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be actor to choose-card
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+ When the actor chooses card with role seer
+ Then the player named JB should be currently a seer and originally a devoted-servant
+ And the player named JB should have the active acting from actor attribute
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the game's current play should be seer to look
+ And the game's current play should be played by the following players
+ | name |
+ | JB |
+
+ When the seer looks at the player named Olivia
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the player named JB should be currently a actor and originally a devoted-servant
+ And the player named JB should not have the active acting from actor attribute
+
+ Scenario: 🎀 Devoted Servant can't use a card the actor previously used
+
+ Given a created game with additional cards described in file seer-witch-little-girl-additional-cards-for-actor.json and with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | actor |
+ | Olivia | werewolf |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be actor to choose-card
+
+ When the actor chooses card with role little-girl
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be actor to choose-card
+
+ When the player or group skips his turn
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Antoine
+ Then the player named Antoine should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Antoine
+ Then the player named Antoine should be currently a devoted-servant and originally a actor
+ And the player named Antoine should have his role revealed
+ And the player named JB should be currently a actor and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the game's current play should be survivors to vote
+
+ When the player or group skips his turn
+ Then the game's current play should be actor to choose-card
+
+ When the actor chooses card with role little-girl
+ Then the request should have failed with status code 400
+ And the request exception status code should be 400
+ And the request exception message should be "Bad game play payload"
+ And the request exception error should be "Chosen card is already used"
+
+ Scenario: 🎀 Devoted Servant idiot role is revealed if he was revealed before
+
+ Given a created game with options described in file no-sheriff-option.json and with the following players
+ | name | role |
+ | Antoine | idiot |
+ | Olivia | werewolf |
+ | JB | devoted-servant |
+ | Thomas | villager |
+ Then the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Thomas
+ Then the player named Thomas should be murdered by werewolves from eaten
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the game's current play should be survivors to vote
+
+ When the survivors vote with the following votes
+ | voter | target |
+ | JB | Antoine |
+ Then the player named Antoine should be alive
+ And the player named Antoine should have his role revealed
+ And the game's current play should be werewolves to eat
+
+ When the werewolves eat the player named Antoine
+ Then the player named Antoine should be murdered by werewolves from eaten
+ And the player named Antoine should have his role revealed
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the devoted servant steals the role of the player named Antoine
+ Then the player named Antoine should be currently a devoted-servant and originally a idiot
+ And the player named Antoine should have his role revealed
+ And the player named JB should be currently a idiot and originally a devoted-servant
+ And the player named JB should be on villagers current side and originally be on villagers side
+ And the player named JB should have his role revealed
\ No newline at end of file
diff --git a/tests/acceptance/features/game/features/role/elder.feature b/tests/acceptance/features/game/features/role/elder.feature
index 12014d8d4..4abe55486 100644
--- a/tests/acceptance/features/game/features/role/elder.feature
+++ b/tests/acceptance/features/game/features/role/elder.feature
@@ -33,7 +33,11 @@ Feature: 👴🏻 Elder role
| voter | target |
| Olivia | Antoine |
Then the player named Antoine should be murdered by survivors from vote
- And the following players should have the active powerless from elder attribute
+ And nobody should have the active powerless from elder attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the following players should have the active powerless from elder attribute
| name |
| Juju |
| Doudou |
@@ -57,10 +61,7 @@ Feature: 👴🏻 Elder role
| Antoine |
| Olivia |
| JB |
- And the game's current play should be survivors to bury-dead-bodies
-
- When the survivors bury dead bodies
- Then the game's current play should be werewolves to eat
+ And the game's current play should be werewolves to eat
When the werewolves eat the player named Ali
Then the player named Ali should be murdered by werewolves from eaten
@@ -115,15 +116,16 @@ Feature: 👴🏻 Elder role
When the witch uses death potion on the player named Antoine
Then the player named Antoine should be murdered by witch from death-potion
- And the following players should have the active powerless from elder attribute
+ And nobody should have the active powerless from elder attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the following players should have the active powerless from elder attribute
| name |
| Doudou |
| JB |
| Thomas |
- And the game's current play should be survivors to bury-dead-bodies
-
- When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ And the game's current play should be survivors to vote
When the player or group skips his turn
Then the game's current play should be werewolves to eat
@@ -152,13 +154,14 @@ Feature: 👴🏻 Elder role
When the hunter shoots at the player named Antoine
Then the player named Antoine should be murdered by hunter from shot
- And the following players should have the active powerless from elder attribute
- | name |
- | Doudou |
- | JB |
+ And nobody should have the active powerless from elder attribute
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
+ Then the following players should have the active powerless from elder attribute
+ | name |
+ | Doudou |
+ | JB |
Then the game's current play should be survivors to vote
When the player or group skips his turn
diff --git a/tests/acceptance/features/game/features/role/idiot.feature b/tests/acceptance/features/game/features/role/idiot.feature
index 57fe579c4..a315a1714 100644
--- a/tests/acceptance/features/game/features/role/idiot.feature
+++ b/tests/acceptance/features/game/features/role/idiot.feature
@@ -130,7 +130,16 @@ Feature: 🤪 Idiot role
When the werewolves eat the player named JB
Then the player named JB should be murdered by werewolves from eaten
- And the player named Antoine should be murdered by survivors from reconsider-pardon
+ And the player named Antoine should be alive
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Antoine should be murdered by survivors from reconsider-pardon
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Antoine should not have the active cant-vote from survivors attribute
+ And the player named Antoine should have his role revealed
Scenario: 🤪 Idiot doesn't die if his role is revealed and elder dies with the right option
diff --git a/tests/acceptance/features/game/features/role/role.feature b/tests/acceptance/features/game/features/role/role.feature
index bdf27464e..a9b73057b 100644
--- a/tests/acceptance/features/game/features/role/role.feature
+++ b/tests/acceptance/features/game/features/role/role.feature
@@ -2,7 +2,7 @@
Feature: 🃏 Role
- Scenario: 🃏 Role is revealed when the player dies
+ Scenario: 🃏 Role is revealed when the player is buried
Given a created game with options described in file no-sheriff-option.json and with the following players
| name | role |
@@ -14,9 +14,13 @@ Feature: 🃏 Role
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
- And the player named Antoine should have his role revealed
+ And the player named Antoine should not have his role revealed
+ And the game's current play should be survivors to bury-dead-bodies
- Scenario: 🃏 Role is not revealed when the player dies with the correct option
+ When the survivors bury dead bodies
+ Then the player named Antoine should have his role revealed
+
+ Scenario: 🃏 Role is not revealed when the player is buried with the correct option
Given a created game with options described in file no-sheriff-option.json, role-not-revealed-on-death-option.json and with the following players
| name | role |
@@ -28,4 +32,8 @@ Feature: 🃏 Role
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
- And the player named Antoine should not have his role revealed
\ No newline at end of file
+ And the player named Antoine should not have his role revealed
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Antoine should not have his role revealed
\ No newline at end of file
diff --git a/tests/acceptance/features/game/features/role/rusty-sword-knight.feature b/tests/acceptance/features/game/features/role/rusty-sword-knight.feature
index a8928a71c..2e80a0b0f 100644
--- a/tests/acceptance/features/game/features/role/rusty-sword-knight.feature
+++ b/tests/acceptance/features/game/features/role/rusty-sword-knight.feature
@@ -16,12 +16,16 @@ Feature: 🤺 Rusty Sword Knight role
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
- And the player named Babou should have the active contaminated from rusty-sword-knight attribute
+ And the player named Babou should not have the active contaminated from rusty-sword-knight attribute
And the player named Babou should be alive
And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ Then the player named Babou should have the active contaminated from rusty-sword-knight attribute
+ And the player named Babou should be alive
+ And the game's current play should be survivors to vote
When the player or group skips his turn
Then the player named Babou should be murdered by rusty-sword-knight from disease
@@ -40,12 +44,13 @@ Feature: 🤺 Rusty Sword Knight role
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
- And the player named Babou should have the active contaminated from rusty-sword-knight attribute
+ And the player named Babou should not have the active contaminated from rusty-sword-knight attribute
And the player named Babou should be alive
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ Then the player named Babou should have the active contaminated from rusty-sword-knight attribute
+ And the game's current play should be survivors to vote
When the survivors vote with the following votes
| voter | target |
@@ -68,12 +73,16 @@ Feature: 🤺 Rusty Sword Knight role
When the survivors vote with the following votes
| voter | target |
| Thomas | Olivia |
- Then the player named Antoine should have the active powerless from elder attribute
+ Then the player named Antoine should not have the active powerless from elder attribute
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be werewolves to eat
+ Then the player named Antoine should have the active powerless from elder attribute
+ And the game's current play should be werewolves to eat
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
- And the player named Babou should not have the active contaminated from rusty-sword-knight attribute
\ No newline at end of file
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then the player named Babou should not have the active contaminated from rusty-sword-knight attribute
\ No newline at end of file
diff --git a/tests/acceptance/features/game/features/role/scandalmonger.feature b/tests/acceptance/features/game/features/role/scandalmonger.feature
index f320a25a7..63f6db2ab 100644
--- a/tests/acceptance/features/game/features/role/scandalmonger.feature
+++ b/tests/acceptance/features/game/features/role/scandalmonger.feature
@@ -67,11 +67,14 @@ Feature: 🐦⬛ Scandalmonger role
When the werewolves eat the player named JB
Then the player named JB should be murdered by werewolves from eaten
- And the player named JB should not have the active scandalmonger-marked from scandalmonger attribute
+ And the player named JB should have the active scandalmonger-marked from scandalmonger attribute
And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
When the survivors bury dead bodies
- Then the game's current play should be survivors to vote
+ Then the player named JB should not have the active scandalmonger-marked from scandalmonger attribute
+ And the game's current play should be survivors to vote
When the player or group skips his turn
Then the game's current play should be scandalmonger to mark
diff --git a/tests/acceptance/features/game/features/role/scapegoat.feature b/tests/acceptance/features/game/features/role/scapegoat.feature
index 660cc82bb..a29eaf188 100644
--- a/tests/acceptance/features/game/features/role/scapegoat.feature
+++ b/tests/acceptance/features/game/features/role/scapegoat.feature
@@ -123,15 +123,15 @@ Feature: 🐐 Scapegoat role
| Olivia | Thomas |
| Thomas | Olivia |
Then the player named Olivia should be murdered by survivors from vote
- And 3 of the following players should have the active powerless from elder attribute
+ And the game's current play should be survivors to bury-dead-bodies
+
+ When the survivors bury dead bodies
+ Then 3 of the following players should have the active powerless from elder attribute
| name |
| Antoine |
| JB |
| Mom |
- And the game's current play should be survivors to bury-dead-bodies
-
- When the survivors bury dead bodies
- Then the game's current play should be werewolves to eat
+ And the game's current play should be werewolves to eat
When the werewolves eat the player named JB
Then the player named JB should be murdered by werewolves from eaten
@@ -236,6 +236,8 @@ Feature: 🐐 Scapegoat role
When the werewolves eat the player named Olivia
Then the player named Olivia should be murdered by werewolves from eaten
And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
When the survivors bury dead bodies
Then the game's current play should be survivors to vote
diff --git a/tests/acceptance/features/game/features/role/two-sisters.feature b/tests/acceptance/features/game/features/role/two-sisters.feature
index a8b4efc7e..bad80115f 100644
--- a/tests/acceptance/features/game/features/role/two-sisters.feature
+++ b/tests/acceptance/features/game/features/role/two-sisters.feature
@@ -56,6 +56,8 @@ Feature: 👯 Two sisters role
When the werewolves eat the player named Antoine
Then the player named Antoine should be murdered by werewolves from eaten
And the game's current play should be survivors to bury-dead-bodies
+ And the game's current play should not have eligible targets
+ And the game's current play can be skipped
When the survivors bury dead bodies
Then the game's current play should be survivors to vote
diff --git a/tests/acceptance/features/game/features/role/wild-child.feature b/tests/acceptance/features/game/features/role/wild-child.feature
index 85cf8357f..660c6c912 100644
--- a/tests/acceptance/features/game/features/role/wild-child.feature
+++ b/tests/acceptance/features/game/features/role/wild-child.feature
@@ -50,11 +50,14 @@ Feature: 🐒 Wild Child role
| voter | target |
| Maxime | Olivia |
Then the player named Olivia should be murdered by survivors from vote
- And the player named Antoine should be on werewolves current side and originally be on villagers side
+ And the player named Antoine should be on villagers current side and originally be on villagers side
+ And the player named Olivia should have the active worshiped from wild-child attribute
And the game's current play should be survivors to bury-dead-bodies
When the survivors bury dead bodies
- Then the game's current play should be werewolves to eat
+ Then the player named Antoine should be on werewolves current side and originally be on villagers side
+ And the player named Olivia should not have the active worshiped from wild-child attribute
+ And the game's current play should be werewolves to eat
Scenario: 🐒 Wild Child can't choose an unknown player
diff --git a/tests/acceptance/features/game/step-definitions/game-play/game-play.when-steps.ts b/tests/acceptance/features/game/step-definitions/game-play/game-play.when-steps.ts
index bd8df6001..b851d9e29 100644
--- a/tests/acceptance/features/game/step-definitions/game-play/game-play.when-steps.ts
+++ b/tests/acceptance/features/game/step-definitions/game-play/game-play.when-steps.ts
@@ -252,6 +252,14 @@ When(/^the survivors bury dead bodies$/u, async function(this: CustomWorld): Pro
setGameInContext(this.response, this);
});
+When(/^the devoted servant steals the role of the player named (?.+)$/u, async function(this: CustomWorld, targetName: string): Promise {
+ const target = getPlayerWithNameOrThrow(targetName, this.game, new Error("Player name not found"));
+ const makeGamePlayDto: MakeGamePlayDto = { targets: [{ playerId: target._id }] };
+
+ this.response = await makeGamePlayRequest(makeGamePlayDto, this.game, this.app);
+ setGameInContext(this.response, this);
+});
+
When(/^the player or group skips his turn$/u, async function(this: CustomWorld): Promise {
this.response = await makeGamePlayRequest({}, this.game, this.app);
setGameInContext(this.response, this);
diff --git a/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts b/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts
index 2d1b0d28e..eb80cb0c4 100644
--- a/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts
+++ b/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts
@@ -22,8 +22,8 @@ import { truncateAllCollections } from "@tests/e2e/helpers/mongoose.helper";
import { initNestApp } from "@tests/e2e/helpers/nest-app.helper";
import { createFakeGetGameHistoryDto } from "@tests/factories/game/dto/get-game-history/get-game-history.dto.factory";
import { createFakeGameHistoryRecord, createFakeGameHistoryRecordBigBadWolfEatPlay, createFakeGameHistoryRecordDefenderProtectPlay, createFakeGameHistoryRecordPlay, createFakeGameHistoryRecordPlaySource, createFakeGameHistoryRecordPlayTarget, createFakeGameHistoryRecordPlayVoting, createFakeGameHistoryRecordStutteringJudgeChooseSignPlay, createFakeGameHistoryRecordSurvivorsElectSheriffPlay, createFakeGameHistoryRecordSurvivorsVotePlay, createFakeGameHistoryRecordWerewolvesEatPlay, createFakeGameHistoryRecordWitchUsePotionsPlay } from "@tests/factories/game/schemas/game-history-record/game-history-record.schema.factory";
-import { createFakeGamePlayCupidCharms, createFakeGamePlayPiedPiperCharms } from "@tests/factories/game/schemas/game-play/game-play.schema.factory";
-import { createFakeElderAlivePlayer, createFakeSeerAlivePlayer, createFakeWitchAlivePlayer } from "@tests/factories/game/schemas/player/player-with-role.schema.factory";
+import { createFakeGamePlayCupidCharms, createFakeGamePlayPiedPiperCharms, createFakeGamePlayWerewolvesEat } from "@tests/factories/game/schemas/game-play/game-play.schema.factory";
+import { createFakeAccursedWolfFatherAlivePlayer, createFakeElderAlivePlayer, createFakeStutteringJudgeAlivePlayer, createFakeWitchAlivePlayer } from "@tests/factories/game/schemas/player/player-with-role.schema.factory";
import { createFakePlayer } from "@tests/factories/game/schemas/player/player.schema.factory";
import { createFakeGameHistoryRecordToInsert } from "@tests/factories/game/types/game-history-record/game-history-record.type.factory";
import { createFakeObjectId } from "@tests/factories/shared/mongoose/mongoose.factory";
@@ -176,36 +176,97 @@ describe("Game History Record Repository", () => {
describe("getLastGameHistoryDefenderProtectsRecord", () => {
it("should return no record when there is no defender play in the history.", async() => {
+ const defenderPlayerId = createFakeObjectId();
const gameId = createFakeObjectId();
await populate([
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWerewolvesEatPlay() }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
]);
- await expect(repositories.gameHistoryRecord.getLastGameHistoryDefenderProtectsRecord(gameId)).resolves.toBeNull();
+ await expect(repositories.gameHistoryRecord.getLastGameHistoryDefenderProtectsRecord(gameId, defenderPlayerId)).resolves.toBeNull();
});
it("should return no record when there gameId is not the good one.", async() => {
+ const defenderPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakePlayer({ _id: defenderPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
await populate([
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordDefenderProtectPlay() }),
+ createFakeGameHistoryRecord({
+ gameId, play: createFakeGameHistoryRecordDefenderProtectPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.DEFENDER,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
]);
- await expect(repositories.gameHistoryRecord.getLastGameHistoryDefenderProtectsRecord(otherGameId)).resolves.toBeNull();
+ await expect(repositories.gameHistoryRecord.getLastGameHistoryDefenderProtectsRecord(otherGameId, defenderPlayerId)).resolves.toBeNull();
});
it("should return the last defender game history play record when called.", async() => {
+ const defenderPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakePlayer({ _id: defenderPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const gameHistoryRecords = [
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordDefenderProtectPlay(), createdAt: new Date("2020-01-01") }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay(), createdAt: new Date("2021-01-01") }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordDefenderProtectPlay(), createdAt: new Date("2022-01-01") }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay(), createdAt: new Date("2023-01-01") }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordDefenderProtectPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.DEFENDER,
+ players,
+ }),
+ }),
+ createdAt: new Date("2020-01-01"),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ createdAt: new Date("2021-01-01"),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordDefenderProtectPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.DEFENDER,
+ players,
+ }),
+ }),
+ createdAt: new Date("2022-01-01"),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay(),
+ createdAt: new Date("2023-01-01"),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordDefenderProtectPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.DEFENDER,
+ players: [createFakePlayer()],
+ }),
+ }),
+ createdAt: new Date("2024-01-01"),
+ }),
];
await populate(gameHistoryRecords);
- const record = await repositories.gameHistoryRecord.getLastGameHistoryDefenderProtectsRecord(gameId);
+ const record = await repositories.gameHistoryRecord.getLastGameHistoryDefenderProtectsRecord(gameId, defenderPlayerId);
expect(toJSON(record)).toStrictEqual(toJSON(gameHistoryRecords[2]) as GameHistoryRecord);
});
@@ -264,93 +325,208 @@ describe("Game History Record Repository", () => {
describe("getGameHistoryWitchUsesSpecificPotionRecords", () => {
it("should get no record when there are no witch play.", async() => {
+ const witchPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeWitchAlivePlayer({ _id: witchPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const gameHistoryRecordPlayTieVoting = createFakeGameHistoryRecordPlayVoting({ result: GameHistoryRecordVotingResults.TIE });
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ voting: gameHistoryRecordPlayTieVoting }) }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWerewolvesEatPlay() }),
+ createFakeGameHistoryRecord({
+ gameId, play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.WEREWOLVES,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordDefenderProtectPlay() }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ voting: gameHistoryRecordPlayTieVoting }) }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, WitchPotions.LIFE);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, witchPlayerId, WitchPotions.LIFE);
expect(toJSON(records)).toStrictEqual([]);
});
it("should get no record when there are no witch using life potion play.", async() => {
+ const witchPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeWitchAlivePlayer({ _id: witchPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH })] }) }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players: [
+ createFakePlayer(),
+ createFakePlayer(),
+ createFakePlayer(),
+ ],
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, WitchPotions.LIFE);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, witchPlayerId, WitchPotions.LIFE);
expect(toJSON(records)).toStrictEqual([]);
});
it("should get records of witch using life potion for this gameId when called.", async() => {
+ const witchPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeWitchAlivePlayer({ _id: witchPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })] }) }),
createFakeGameHistoryRecord({
- gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
targets: [
createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE }),
createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH }),
],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
}),
}),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
- createFakeGameHistoryRecord({ gameId: otherGameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })] }) }),
+ createFakeGameHistoryRecord({
+ gameId: otherGameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, WitchPotions.LIFE);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, witchPlayerId, WitchPotions.LIFE);
const expectedRecords = [gameHistoryRecords[1], gameHistoryRecords[2]];
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
});
it("should get no record when there are no witch using death potion play.", async() => {
+ const witchPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeWitchAlivePlayer({ _id: witchPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })] }) }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, WitchPotions.DEATH);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, witchPlayerId, WitchPotions.DEATH);
expect(toJSON(records)).toStrictEqual([]);
});
it("should get records of witch using death potion for this gameId when called.", async() => {
+ const witchPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeWitchAlivePlayer({ _id: witchPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH })] }) }),
createFakeGameHistoryRecord({
- gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
targets: [
createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.LIFE }),
createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH }),
],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
}),
}),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
- createFakeGameHistoryRecord({ gameId: otherGameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH })] }) }),
+ createFakeGameHistoryRecord({
+ gameId: otherGameId,
+ play: createFakeGameHistoryRecordWitchUsePotionsPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ drankPotion: WitchPotions.DEATH })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.WITCH,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, WitchPotions.DEATH);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWitchUsesSpecificPotionRecords(gameId, witchPlayerId, WitchPotions.DEATH);
const expectedRecords = [gameHistoryRecords[1], gameHistoryRecords[2]];
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
@@ -359,6 +535,7 @@ describe("Game History Record Repository", () => {
describe("getGameHistoryAccursedWolfFatherInfectedRecords", () => {
it("should get no record when there are no eat play.", async() => {
+ const accursedWolfFatherPlayerId = createFakeObjectId();
const gameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
@@ -367,24 +544,71 @@ describe("Game History Record Repository", () => {
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryAccursedWolfFatherInfectedRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryAccursedWolfFatherInfectedRecords(gameId, accursedWolfFatherPlayerId);
expect(toJSON(records)).toStrictEqual([]);
});
it("should get records of accursed wolf-father infected for this gameId when called.", async() => {
+ const accursedWolfFatherPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeAccursedWolfFatherAlivePlayer({ _id: accursedWolfFatherPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWerewolvesEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: false })] }) }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWerewolvesEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: true })] }) }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: false })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.WEREWOLVES,
+ players,
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: true })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.WEREWOLVES,
+ players,
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: true })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.WEREWOLVES,
+ players: [
+ createFakePlayer(),
+ createFakePlayer(),
+ createFakePlayer(),
+ ],
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
- createFakeGameHistoryRecord({ gameId: otherGameId, play: createFakeGameHistoryRecordWerewolvesEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: true })] }) }),
+ createFakeGameHistoryRecord({
+ gameId: otherGameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ targets: [createFakeGameHistoryRecordPlayTarget({ isInfected: true })],
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.WEREWOLVES,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryAccursedWolfFatherInfectedRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryAccursedWolfFatherInfectedRecords(gameId, accursedWolfFatherPlayerId);
const expectedRecords = [gameHistoryRecords[2]];
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
@@ -393,32 +617,95 @@ describe("Game History Record Repository", () => {
describe("getGameHistoryJudgeRequestRecords", () => {
it("should get no record when there are no vote with judge request play.", async() => {
+ const stutteringJudgePlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeStutteringJudgeAlivePlayer({ _id: stutteringJudgePlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ didJudgeRequestAnotherVote: false }) }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordDefenderProtectPlay() }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordDefenderProtectPlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.SURVIVORS,
+ players: [
+ players[1],
+ players[2],
+ ],
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryJudgeRequestRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryJudgeRequestRecords(gameId, stutteringJudgePlayerId);
expect(toJSON(records)).toStrictEqual([]);
});
it("should get records of stuttering judge requesting another vote for this gameId when called.", async() => {
+ const stutteringJudgePlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeStutteringJudgeAlivePlayer({ _id: stutteringJudgePlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ didJudgeRequestAnotherVote: true }) }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ didJudgeRequestAnotherVote: false }) }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordSurvivorsVotePlay({
+ didJudgeRequestAnotherVote: true,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.SURVIVORS,
+ players,
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordSurvivorsVotePlay({
+ didJudgeRequestAnotherVote: false,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.SURVIVORS,
+ players,
+ }),
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
- createFakeGameHistoryRecord({ gameId: otherGameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ didJudgeRequestAnotherVote: true }) }),
+ createFakeGameHistoryRecord({
+ gameId: otherGameId,
+ play: createFakeGameHistoryRecordSurvivorsVotePlay({
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.SURVIVORS,
+ players,
+ }),
+ didJudgeRequestAnotherVote: true,
+ }),
+ }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordSurvivorsVotePlay({
+ didJudgeRequestAnotherVote: true,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.SURVIVORS,
+ players: [
+ createFakePlayer(),
+ createFakePlayer(),
+ ],
+ }),
+ }),
+ }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryJudgeRequestRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryJudgeRequestRecords(gameId, stutteringJudgePlayerId);
const expectedRecords = [gameHistoryRecords[1]];
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
@@ -461,6 +748,7 @@ describe("Game History Record Repository", () => {
describe("getGameHistoryWerewolvesEatElderRecords", () => {
it("should get no record when there are no eat play.", async() => {
+ const elderPlayerId = createFakeObjectId();
const gameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ didJudgeRequestAnotherVote: false }) }),
@@ -469,40 +757,57 @@ describe("Game History Record Repository", () => {
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWerewolvesEatElderRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWerewolvesEatElderRecords(gameId, elderPlayerId);
expect(toJSON(records)).toStrictEqual([]);
});
it("should get records of elder eaten by any kind of werewolves for this gameId when called.", async() => {
+ const elderPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeElderAlivePlayer({ _id: elderPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
const gameHistoryRecords = [
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
createFakeGameHistoryRecord({
- gameId, play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ gameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
targets: [
- createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer() }),
- createFakeGameHistoryRecordPlayTarget({ player: createFakeWitchAlivePlayer() }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[1] }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[0] }),
],
}),
}),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay({ didJudgeRequestAnotherVote: false }) }),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordBigBadWolfEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer() })] }) }),
+ createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordBigBadWolfEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: players[1] })] }) }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordWitchUsePotionsPlay() }),
createFakeGameHistoryRecord({
- gameId: otherGameId, play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ gameId: otherGameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
targets: [
- createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer() }),
- createFakeGameHistoryRecordPlayTarget({ player: createFakeWitchAlivePlayer() }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[1] }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[0] }),
],
}),
}),
- createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordBigBadWolfEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: createFakeSeerAlivePlayer() })] }) }),
+ createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordBigBadWolfEatPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: players[0] })] }) }),
createFakeGameHistoryRecord({ gameId, play: createFakeGameHistoryRecordSurvivorsVotePlay() }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordWerewolvesEatPlay({
+ targets: [
+ createFakeGameHistoryRecordPlayTarget({ player: players[2] }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[0] }),
+ ],
+ }),
+ }),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryWerewolvesEatElderRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryWerewolvesEatElderRecords(gameId, elderPlayerId);
const expectedRecords = [gameHistoryRecords[1], gameHistoryRecords[3]];
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
@@ -511,6 +816,12 @@ describe("Game History Record Repository", () => {
describe("getGameHistoryElderProtectedFromWerewolvesRecords", () => {
it("should get game history where elder is protected from werewolves records for gameId when called.", async() => {
+ const elderPlayerId = createFakeObjectId();
+ const players = [
+ createFakePlayer(),
+ createFakeElderAlivePlayer({ _id: elderPlayerId }),
+ createFakePlayer(),
+ ];
const gameId = createFakeObjectId();
const otherGameId = createFakeObjectId();
const gameHistoryRecords = [
@@ -519,25 +830,25 @@ describe("Game History Record Repository", () => {
gameId,
play: createFakeGameHistoryRecordDefenderProtectPlay({
targets: [
- createFakeGameHistoryRecordPlayTarget({ player: createFakeSeerAlivePlayer() }),
- createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer() }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[0] }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[1] }),
],
}),
}),
createFakeGameHistoryRecord({
gameId: otherGameId,
- play: createFakeGameHistoryRecordDefenderProtectPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer() })] }),
+ play: createFakeGameHistoryRecordDefenderProtectPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: players[1] })] }),
}),
createFakeGameHistoryRecord({
gameId,
- play: createFakeGameHistoryRecordDefenderProtectPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: createFakeSeerAlivePlayer() })] }),
+ play: createFakeGameHistoryRecordDefenderProtectPlay({ targets: [createFakeGameHistoryRecordPlayTarget({ player: players[0] })] }),
}),
createFakeGameHistoryRecord({
gameId,
play: createFakeGameHistoryRecordWitchUsePotionsPlay({
targets: [
- createFakeGameHistoryRecordPlayTarget({ player: createFakeSeerAlivePlayer(), drankPotion: WitchPotions.LIFE }),
- createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer(), drankPotion: WitchPotions.DEATH }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[0], drankPotion: WitchPotions.LIFE }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[1], drankPotion: WitchPotions.DEATH }),
],
}),
}),
@@ -545,14 +856,23 @@ describe("Game History Record Repository", () => {
gameId,
play: createFakeGameHistoryRecordWitchUsePotionsPlay({
targets: [
- createFakeGameHistoryRecordPlayTarget({ player: createFakeSeerAlivePlayer(), drankPotion: WitchPotions.DEATH }),
- createFakeGameHistoryRecordPlayTarget({ player: createFakeElderAlivePlayer(), drankPotion: WitchPotions.LIFE }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[0], drankPotion: WitchPotions.DEATH }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[1], drankPotion: WitchPotions.LIFE }),
+ ],
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordDefenderProtectPlay({
+ targets: [
+ createFakeGameHistoryRecordPlayTarget({ player: players[0] }),
+ createFakeGameHistoryRecordPlayTarget({ player: players[2] }),
],
}),
}),
];
await populate(gameHistoryRecords);
- const records = await repositories.gameHistoryRecord.getGameHistoryElderProtectedFromWerewolvesRecords(gameId);
+ const records = await repositories.gameHistoryRecord.getGameHistoryElderProtectedFromWerewolvesRecords(gameId, elderPlayerId);
const expectedRecords = [gameHistoryRecords[1], gameHistoryRecords[5]];
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
@@ -669,6 +989,112 @@ describe("Game History Record Repository", () => {
},
])(`$test`, async({ gameId: id, gamePlay, expectedRecords }) => {
const records = await repositories.gameHistoryRecord.getGameHistoryGamePlayRecords(id, gamePlay);
+
+ expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
+ });
+ });
+
+ describe("getGameHistoryGamePlayMadeByPlayerRecords", () => {
+ const gameId = createFakeObjectId();
+ const otherGameId = createFakeObjectId();
+ const player = createFakePlayer();
+
+ const gameHistoryRecords = [
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordPlay({
+ action: GamePlayActions.CHARM,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.CUPID,
+ players: [
+ createFakePlayer(),
+ player,
+ createFakePlayer(),
+ ],
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordPlay({
+ action: GamePlayActions.EAT,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: PlayerGroups.WEREWOLVES,
+ players: [
+ createFakePlayer(),
+ createFakePlayer(),
+ ],
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId: otherGameId,
+ play: createFakeGameHistoryRecordPlay({
+ action: GamePlayActions.CHARM,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.PIED_PIPER,
+ players: [
+ createFakePlayer(),
+ player,
+ createFakePlayer(),
+ ],
+ }),
+ }),
+ }),
+ createFakeGameHistoryRecord({
+ gameId,
+ play: createFakeGameHistoryRecordPlay({
+ action: GamePlayActions.CHARM,
+ source: createFakeGameHistoryRecordPlaySource({
+ name: RoleNames.CUPID,
+ players: [
+ createFakePlayer(),
+ player,
+ createFakePlayer(),
+ ],
+ }),
+ cause: GamePlayCauses.ANGEL_PRESENCE,
+ }),
+ }),
+ ];
+
+ beforeEach(async() => {
+ await populate(gameHistoryRecords);
+ });
+
+ it.each<{
+ test: string;
+ gameId: Types.ObjectId;
+ gamePlay: GamePlay;
+ expectedRecords: GameHistoryRecord[];
+ }>([
+ {
+ test: "should get one record when cupid charming.",
+ gameId,
+ gamePlay: createFakeGamePlayCupidCharms(),
+ expectedRecords: [gameHistoryRecords[0]],
+ },
+ {
+ test: "should get no record when pied-piper charming but on wrong game.",
+ gameId,
+ gamePlay: createFakeGamePlayPiedPiperCharms(),
+ expectedRecords: [],
+ },
+ {
+ test: "should get no record when werewolves eating but player is not found in game play.",
+ gameId,
+ gamePlay: createFakeGamePlayWerewolvesEat(),
+ expectedRecords: [],
+ },
+ {
+ test: "should get one record when cupid charming because of angel presence.",
+ gameId,
+ gamePlay: createFakeGamePlayCupidCharms({ cause: GamePlayCauses.ANGEL_PRESENCE }),
+ expectedRecords: [gameHistoryRecords[3]],
+ },
+ ])(`$test`, async({ gameId: id, gamePlay, expectedRecords }) => {
+ const records = await repositories.gameHistoryRecord.getGameHistoryGamePlayMadeByPlayerRecords(id, gamePlay, player);
+
expect(toJSON(records)).toStrictEqual(toJSON(expectedRecords) as GameHistoryRecord[]);
});
});
diff --git a/tests/factories/game/schemas/game-history-record/game-history-record.schema.factory.ts b/tests/factories/game/schemas/game-history-record/game-history-record.schema.factory.ts
index ec99d3b95..0621726b0 100644
--- a/tests/factories/game/schemas/game-history-record/game-history-record.schema.factory.ts
+++ b/tests/factories/game/schemas/game-history-record/game-history-record.schema.factory.ts
@@ -1,7 +1,7 @@
import { faker } from "@faker-js/faker";
import { plainToInstance } from "class-transformer";
-import { GAME_SOURCES } from "@/modules/game/constants/game.constant";
+import { GAME_PLAY_SOURCE_NAMES } from "@/modules/game/constants/game-play/game-play.constant";
import { GameHistoryRecordVotingResults } from "@/modules/game/enums/game-history-record.enum";
import { GamePlayActions } from "@/modules/game/enums/game-play.enum";
import { GamePhases } from "@/modules/game/enums/game.enum";
@@ -280,7 +280,7 @@ function createFakeGameHistoryRecordSheriffSettleVotesPlay(gameHistoryRecordPlay
function createFakeGameHistoryRecordPlaySource(gameHistoryRecordPlaySource: Partial = {}, override: object = {}): GameHistoryRecordPlaySource {
return plainToInstance(GameHistoryRecordPlaySource, {
- name: gameHistoryRecordPlaySource.name ?? faker.helpers.arrayElement(GAME_SOURCES),
+ name: gameHistoryRecordPlaySource.name ?? faker.helpers.arrayElement(GAME_PLAY_SOURCE_NAMES),
players: gameHistoryRecordPlaySource.players ?? [createFakePlayer()],
...override,
}, DEFAULT_PLAIN_TO_INSTANCE_OPTIONS);
diff --git a/tests/factories/game/schemas/player/player-attribute/player-attribute.schema.factory.ts b/tests/factories/game/schemas/player/player-attribute/player-attribute.schema.factory.ts
index 20deb3e88..661ff0ee1 100644
--- a/tests/factories/game/schemas/player/player-attribute/player-attribute.schema.factory.ts
+++ b/tests/factories/game/schemas/player/player-attribute/player-attribute.schema.factory.ts
@@ -11,6 +11,23 @@ import { RoleNames } from "@/modules/role/enums/role.enum";
import { DEFAULT_PLAIN_TO_INSTANCE_OPTIONS } from "@/shared/validation/constants/validation.constant";
+function createFakeActingByActorPlayerAttribute(attribute: Partial = {}, override: object = {}): PlayerAttribute {
+ return createFakePlayerAttribute({
+ name: PlayerAttributeNames.ACTING,
+ source: RoleNames.ACTOR,
+ ...attribute,
+ }, override);
+}
+
+function createFakeStolenRoleByDevotedServantPlayerAttribute(attribute: Partial = {}, override: object = {}): PlayerAttribute {
+ return createFakePlayerAttribute({
+ name: PlayerAttributeNames.STOLEN_ROLE,
+ source: RoleNames.DEVOTED_SERVANT,
+ doesRemainAfterDeath: true,
+ ...attribute,
+ }, override);
+}
+
function createFakeSheriffBySheriffPlayerAttribute(attribute: Partial = {}, override: object = {}): PlayerAttribute {
return createFakePlayerAttribute({
name: PlayerAttributeNames.SHERIFF,
@@ -229,6 +246,8 @@ function createFakePlayerAttribute(attribute: Partial = {}, ove
}
export {
+ createFakeActingByActorPlayerAttribute,
+ createFakeStolenRoleByDevotedServantPlayerAttribute,
createFakeSheriffBySheriffPlayerAttribute,
createFakeSheriffBySurvivorsPlayerAttribute,
createFakeSeenBySeerPlayerAttribute,
diff --git a/tests/factories/game/schemas/player/player-with-role.schema.factory.ts b/tests/factories/game/schemas/player/player-with-role.schema.factory.ts
index 904e11883..76eb3b6e1 100644
--- a/tests/factories/game/schemas/player/player-with-role.schema.factory.ts
+++ b/tests/factories/game/schemas/player/player-with-role.schema.factory.ts
@@ -124,6 +124,10 @@ function createFakeActorAlivePlayer(player: Partial = {}, override: obje
return createFakeAlivePlayerWithRole(RoleNames.ACTOR, player, override);
}
+function createFakeDevotedServantAlivePlayer(player: Partial = {}, override: object = {}): Player {
+ return createFakeAlivePlayerWithRole(RoleNames.DEVOTED_SERVANT, player, override);
+}
+
function createFakeAlivePlayerWithRole(role: RoleNames, player: Partial = {}, override: object = {}): Player {
const playerRole: PlayerRole = {
current: role,
@@ -175,4 +179,5 @@ export {
createFakeScandalmongerAlivePlayer,
createFakePrejudicedManipulatorAlivePlayer,
createFakeActorAlivePlayer,
+ createFakeDevotedServantAlivePlayer,
};
\ No newline at end of file
diff --git a/tests/factories/game/schemas/player/player.schema.factory.ts b/tests/factories/game/schemas/player/player.schema.factory.ts
index fb7b7e629..2cd29ad2c 100644
--- a/tests/factories/game/schemas/player/player.schema.factory.ts
+++ b/tests/factories/game/schemas/player/player.schema.factory.ts
@@ -1,6 +1,7 @@
import { faker } from "@faker-js/faker";
import { plainToInstance } from "class-transformer";
+import { DeadPlayer } from "@/modules/game/schemas/player/dead-player.schema";
import { PlayerRole } from "@/modules/game/schemas/player/player-role/player-role.schema";
import { PlayerSide } from "@/modules/game/schemas/player/player-side/player-side.schema";
import { Player } from "@/modules/game/schemas/player/player.schema";
@@ -28,6 +29,15 @@ function createFakePlayerRole(playerRole: Partial = {}, override: ob
}, DEFAULT_PLAIN_TO_INSTANCE_OPTIONS);
}
+function createFakeDeadPlayer(deadPlayer: Partial = {}, override: object = {}): DeadPlayer {
+ return plainToInstance(DeadPlayer, {
+ ...createFakePlayer(deadPlayer),
+ death: createFakePlayerDeath(deadPlayer.death),
+ isAlive: false,
+ ...override,
+ }, DEFAULT_PLAIN_TO_INSTANCE_OPTIONS);
+}
+
function createFakePlayer(player: Partial = {}, override: object = {}): Player {
return plainToInstance(Player, {
_id: player._id ?? createFakeObjectId(),
@@ -46,5 +56,6 @@ function createFakePlayer(player: Partial = {}, override: object = {}):
export {
createFakePlayerSide,
createFakePlayerRole,
+ createFakeDeadPlayer,
createFakePlayer,
};
\ No newline at end of file
diff --git a/tests/stryker/incremental.json b/tests/stryker/incremental.json
index eec03567e..2ca59fe85 100644
--- a/tests/stryker/incremental.json
+++ b/tests/stryker/incremental.json
@@ -12,12 +12,12 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1237",
- "1238",
- "1239",
- "1240",
- "1241",
- "1242"
+ "1311",
+ "1312",
+ "1313",
+ "1314",
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -39,12 +39,12 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1237",
- "1238",
- "1239",
- "1240",
- "1241",
- "1242"
+ "1311",
+ "1312",
+ "1313",
+ "1314",
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -66,12 +66,12 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1237",
- "1238",
- "1239",
- "1240",
- "1241",
- "1242"
+ "1311",
+ "1312",
+ "1313",
+ "1314",
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -93,12 +93,12 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1237",
- "1238",
- "1239",
- "1240",
- "1241",
- "1242"
+ "1311",
+ "1312",
+ "1313",
+ "1314",
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -120,12 +120,12 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1237",
- "1238",
- "1239",
- "1240",
- "1241",
- "1242"
+ "1311",
+ "1312",
+ "1313",
+ "1314",
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -147,8 +147,8 @@
"static": false,
"killedBy": [],
"coveredBy": [
- "1237",
- "1242"
+ "1311",
+ "1316"
],
"location": {
"end": {
@@ -170,10 +170,10 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1238",
- "1239",
- "1240",
- "1241"
+ "1312",
+ "1313",
+ "1314",
+ "1315"
],
"location": {
"end": {
@@ -195,10 +195,10 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1238",
- "1239",
- "1240",
- "1241"
+ "1312",
+ "1313",
+ "1314",
+ "1315"
],
"location": {
"end": {
@@ -220,10 +220,10 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1238",
- "1239",
- "1240",
- "1241"
+ "1312",
+ "1313",
+ "1314",
+ "1315"
],
"location": {
"end": {
@@ -240,16 +240,16 @@
"id": "9",
"mutatorName": "BlockStatement",
"replacement": "{}",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1234\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1234\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1239"
+ "1313"
],
"coveredBy": [
- "1239",
- "1241"
+ "1313",
+ "1315"
],
"location": {
"end": {
@@ -266,16 +266,16 @@
"id": "10",
"mutatorName": "ArithmeticOperator",
"replacement": "(parseInt(process.env.JEST_WORKER_ID) - 1) / portMultiplier",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1234.5\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1234.5\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1239"
+ "1313"
],
"coveredBy": [
- "1239",
- "1241"
+ "1313",
+ "1315"
],
"location": {
"end": {
@@ -292,16 +292,16 @@
"id": "11",
"mutatorName": "ArithmeticOperator",
"replacement": "parseInt(process.env.JEST_WORKER_ID) + 1",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1240\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1240\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1239"
+ "1313"
],
"coveredBy": [
- "1239",
- "1241"
+ "1313",
+ "1315"
],
"location": {
"end": {
@@ -318,16 +318,16 @@
"id": "12",
"mutatorName": "ArithmeticOperator",
"replacement": "parseInt(port) - portAdjuster",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1232\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1236\nReceived: 1232\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:80:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1239"
+ "1313"
],
"coveredBy": [
- "1239",
- "1241"
+ "1313",
+ "1315"
],
"location": {
"end": {
@@ -349,8 +349,8 @@
"static": false,
"killedBy": [],
"coveredBy": [
- "1238",
- "1240"
+ "1312",
+ "1314"
],
"location": {
"end": {
@@ -372,8 +372,8 @@
"static": false,
"killedBy": [],
"coveredBy": [
- "1238",
- "1240"
+ "1312",
+ "1314"
],
"location": {
"end": {
@@ -395,8 +395,8 @@
"static": false,
"killedBy": [],
"coveredBy": [
- "1238",
- "1240"
+ "1312",
+ "1314"
],
"location": {
"end": {
@@ -413,15 +413,15 @@
"id": "16",
"mutatorName": "BlockStatement",
"replacement": "{}",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1238\nReceived: 1234\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:88:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1238\nReceived: 1234\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:88:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 1,
"static": false,
"killedBy": [
- "1240"
+ "1314"
],
"coveredBy": [
- "1240"
+ "1314"
],
"location": {
"end": {
@@ -438,15 +438,15 @@
"id": "17",
"mutatorName": "ArithmeticOperator",
"replacement": "parseInt(process.env.CUCUMBER_WORKER_ID) / portMultiplier",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1238\nReceived: 1235\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:88:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1238\nReceived: 1235\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:88:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 1,
"static": false,
"killedBy": [
- "1240"
+ "1314"
],
"coveredBy": [
- "1240"
+ "1314"
],
"location": {
"end": {
@@ -463,15 +463,15 @@
"id": "18",
"mutatorName": "ArithmeticOperator",
"replacement": "parseInt(port) - portAdjuster",
- "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1238\nReceived: 1230\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:88:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toBe(expected) // Object.is equality\n\nExpected: 1238\nReceived: 1230\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:88:48)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 1,
"static": false,
"killedBy": [
- "1240"
+ "1314"
],
"coveredBy": [
- "1240"
+ "1314"
],
"location": {
"end": {
@@ -493,8 +493,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -516,8 +516,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -539,8 +539,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -562,8 +562,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -585,8 +585,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -603,16 +603,16 @@
"id": "24",
"mutatorName": "ConditionalExpression",
"replacement": "true",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb+srv://localhost\",\n+ \"uri\": \"mongodb://localhost:undefined\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:126:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb+srv://localhost\",\n+ \"uri\": \"mongodb://localhost:undefined\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:126:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1242"
+ "1316"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -629,16 +629,16 @@
"id": "25",
"mutatorName": "ConditionalExpression",
"replacement": "false",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n+ \"uri\": \"mongodb+srv://localhost\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n+ \"uri\": \"mongodb+srv://localhost\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -655,16 +655,16 @@
"id": "26",
"mutatorName": "EqualityOperator",
"replacement": "port === undefined",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n+ \"uri\": \"mongodb+srv://localhost\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n+ \"uri\": \"mongodb+srv://localhost\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -681,15 +681,15 @@
"id": "27",
"mutatorName": "StringLiteral",
"replacement": "``",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n+ \"uri\": \"\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n+ \"uri\": \"\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 1,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241"
+ "1315"
],
"location": {
"end": {
@@ -706,15 +706,15 @@
"id": "28",
"mutatorName": "StringLiteral",
"replacement": "``",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb+srv://localhost\",\n+ \"uri\": \"\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:126:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -8,8 +8,8 @@\n \"deprecationErrors\": true,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb+srv://localhost\",\n+ \"uri\": \"\",\n \"user\": \"user\",\n }\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:126:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 1,
"static": false,
"killedBy": [
- "1242"
+ "1316"
],
"coveredBy": [
- "1242"
+ "1316"
],
"location": {
"end": {
@@ -731,16 +731,16 @@
"id": "29",
"mutatorName": "ObjectLiteral",
"replacement": "{}",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 15\n+ Received + 1\n\n- Object {\n- \"authSource\": \"admin\",\n- \"dbName\": \"test\",\n- \"pass\": \"password\",\n- \"retryAttempts\": 3,\n- \"retryDelay\": 3000,\n- \"serverApi\": Object {\n- \"deprecationErrors\": true,\n- \"strict\": true,\n- \"version\": \"1\",\n- },\n- \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n- \"user\": \"user\",\n- }\n+ Object {}\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 15\n+ Received + 1\n\n- Object {\n- \"authSource\": \"admin\",\n- \"dbName\": \"test\",\n- \"pass\": \"password\",\n- \"retryAttempts\": 3,\n- \"retryDelay\": 3000,\n- \"serverApi\": Object {\n- \"deprecationErrors\": true,\n- \"strict\": true,\n- \"version\": \"1\",\n- },\n- \"serverSelectionTimeoutMS\": 3000,\n- \"uri\": \"mongodb://localhost:1234\",\n- \"user\": \"user\",\n- }\n+ Object {}\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -757,16 +757,16 @@
"id": "30",
"mutatorName": "StringLiteral",
"replacement": "\"\"",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -1,7 +1,7 @@\n Object {\n- \"authSource\": \"admin\",\n+ \"authSource\": \"\",\n \"dbName\": \"test\",\n \"pass\": \"password\",\n \"retryAttempts\": 3,\n \"retryDelay\": 3000,\n \"serverApi\": Object {\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -1,7 +1,7 @@\n Object {\n- \"authSource\": \"admin\",\n+ \"authSource\": \"\",\n \"dbName\": \"test\",\n \"pass\": \"password\",\n \"retryAttempts\": 3,\n \"retryDelay\": 3000,\n \"serverApi\": Object {\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -788,8 +788,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -811,8 +811,8 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -829,16 +829,16 @@
"id": "33",
"mutatorName": "BooleanLiteral",
"replacement": "false",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -4,11 +4,11 @@\n \"pass\": \"password\",\n \"retryAttempts\": 3,\n \"retryDelay\": 3000,\n \"serverApi\": Object {\n \"deprecationErrors\": true,\n- \"strict\": true,\n+ \"strict\": false,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n \"uri\": \"mongodb://localhost:1234\",\n \"user\": \"user\",\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -4,11 +4,11 @@\n \"pass\": \"password\",\n \"retryAttempts\": 3,\n \"retryDelay\": 3000,\n \"serverApi\": Object {\n \"deprecationErrors\": true,\n- \"strict\": true,\n+ \"strict\": false,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n \"uri\": \"mongodb://localhost:1234\",\n \"user\": \"user\",\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -855,16 +855,16 @@
"id": "34",
"mutatorName": "BooleanLiteral",
"replacement": "false",
- "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -3,11 +3,11 @@\n \"dbName\": \"test\",\n \"pass\": \"password\",\n \"retryAttempts\": 3,\n \"retryDelay\": 3000,\n \"serverApi\": Object {\n- \"deprecationErrors\": true,\n+ \"deprecationErrors\": false,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n \"uri\": \"mongodb://localhost:1234\",\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "Error: expect(received).toStrictEqual(expected) // deep equality\n\n- Expected - 1\n+ Received + 1\n\n@@ -3,11 +3,11 @@\n \"dbName\": \"test\",\n \"pass\": \"password\",\n \"retryAttempts\": 3,\n \"retryDelay\": 3000,\n \"serverApi\": Object {\n- \"deprecationErrors\": true,\n+ \"deprecationErrors\": false,\n \"strict\": true,\n \"version\": \"1\",\n },\n \"serverSelectionTimeoutMS\": 3000,\n \"uri\": \"mongodb://localhost:1234\",\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/modules/config/database/helpers/database.helper.spec.ts:106:54)\n at Promise.then.completed (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:298:28)\n at new Promise ()\n at callAsyncCircusFn (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/utils.js:231:10)\n at _callCircusTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:316:40)\n at async _runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:252:3)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:126:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async _runTestsForDescribeBlock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:121:9)\n at async run (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/run.js:71:3)\n at async runAndTransformResultsToJestFormat (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:122:21)\n at async jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:79:19)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "Killed",
"testsCompleted": 2,
"static": true,
"killedBy": [
- "1241"
+ "1315"
],
"coveredBy": [
- "1241",
- "1242"
+ "1315",
+ "1316"
],
"location": {
"end": {
@@ -892,25 +892,25 @@
"static": true,
"killedBy": [],
"coveredBy": [
- "1186",
- "1187",
- "1188",
- "1189",
- "1190",
- "1191",
- "1192",
- "1193",
- "1194",
- "1195",
- "1196",
- "1197",
- "1198",
- "1199",
- "1200",
- "1201",
- "1202",
- "1203",
- "1204"
+ "1267",
+ "1268",
+ "1269",
+ "1270",
+ "1271",
+ "1272",
+ "1273",
+ "1274",
+ "1275",
+ "1276",
+ "1277",
+ "1278",
+ "1279",
+ "1280",
+ "1281",
+ "1282",
+ "1283",
+ "1284",
+ "1285"
],
"location": {
"end": {
@@ -927,30 +927,30 @@
"id": "36",
"mutatorName": "ObjectLiteral",
"replacement": "{}",
- "statusReason": "undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/game/controllers/game.controller.e2e-spec.ts:33:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts:23:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/health/controllers/health.controller.e2e-spec.ts:5:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/server/server.ts:56:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/server/server.spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/role/controllers/role.controller.e2e-spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/app.controller.e2e-spec.ts:4:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/modules/game/controllers/game.controller.e2e-spec.ts:33:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts:23:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/server/server.ts:56:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/server/server.spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/modules/health/controllers/health.controller.e2e-spec.ts:5:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/modules/role/controllers/role.controller.e2e-spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/app.controller.e2e-spec.ts:4:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
"status": "RuntimeError",
"static": true,
"killedBy": [],
"coveredBy": [
- "1186",
- "1187",
- "1188",
- "1189",
- "1190",
- "1191",
- "1192",
- "1193",
- "1194",
- "1195",
- "1196",
- "1197",
- "1198",
- "1199",
- "1200",
- "1201",
- "1202",
- "1203",
- "1204"
+ "1267",
+ "1268",
+ "1269",
+ "1270",
+ "1271",
+ "1272",
+ "1273",
+ "1274",
+ "1275",
+ "1276",
+ "1277",
+ "1278",
+ "1279",
+ "1280",
+ "1281",
+ "1282",
+ "1283",
+ "1284",
+ "1285"
],
"location": {
"end": {
@@ -967,30 +967,30 @@
"id": "37",
"mutatorName": "BooleanLiteral",
"replacement": "false",
- "statusReason": "undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts:23:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/game/controllers/game.controller.e2e-spec.ts:33:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/health/controllers/health.controller.e2e-spec.ts:5:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/modules/role/controllers/role.controller.e2e-spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/server/server.ts:56:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/unit/specs/server/server.spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox3960989/tests/e2e/specs/app.controller.e2e-spec.ts:4:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34)",
+ "statusReason": "undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/modules/game/controllers/game.controller.e2e-spec.ts:33:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/helpers/nest-app.helper.ts:12:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/e2e/specs/modules/game/providers/repositories/game-history-record.repository.e2e-spec.ts:23:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/server/server.ts:56:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/tests/unit/specs/server/server.spec.ts:9:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at jestAdapter (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:77:13)\n at async runTestInternal (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:367:16)\n at async runTest (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runner/build/runTest.js:444:34), undefinedAn instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n Error: An instance of EnvironmentVariables has failed the validation:\n - property DATABASE_PORT has failed the following constraints: max, min, isNumber \n\n at Object.validate (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/helpers/env.helper.ts:65:15)\n at Function.forRoot (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/@nestjs/config/dist/config.module.js:70:45)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/modules/config/env/env.module.ts:6:26)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object. (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/.stryker-tmp/sandbox4550895/src/app.module.ts:3:1)\n at Runtime._execModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1439:24)\n at Runtime._loadModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1022:12)\n at Runtime.requireModule (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:882:12)\n at Runtime.requireModuleOrMock (/Users/antoinezanardi/WebstormProjects/werewolves-assistant-api-next/node_modules/jest-runtime/build/index.js:1048:21)\n at Object.