From 88acd8cfef239d6a3968b0cea8d77f398c28c322 Mon Sep 17 00:00:00 2001 From: Divlo Date: Tue, 30 Nov 2021 17:13:37 +0100 Subject: [PATCH] fix(cli): remove duplicate solutions to test --- cli/services/GitAffected.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/cli/services/GitAffected.ts b/cli/services/GitAffected.ts index d88ccd2..0feb58c 100644 --- a/cli/services/GitAffected.ts +++ b/cli/services/GitAffected.ts @@ -114,6 +114,15 @@ export class GitAffected implements GitAffectedOptions { solutions.push(...solutionsByChallenge) } } - return solutions + const solutionsUnique: Solution[] = [] + for (const solution of solutions) { + const isAlreadyIncluded = solutionsUnique.some((solutionUnique) => { + return solutionUnique.path === solution.path + }) + if (!isAlreadyIncluded) { + solutionsUnique.push(solution) + } + } + return solutionsUnique } }