From 8bebb8c54a5c052150066b168c44c2d5184d9446 Mon Sep 17 00:00:00 2001 From: Gabriel Forien Date: Wed, 2 Aug 2023 15:47:34 +0200 Subject: [PATCH] ci(frontend/scripts): print expected quote length (#4499) gforien --- frontend/scripts/json-validation.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/frontend/scripts/json-validation.js b/frontend/scripts/json-validation.js index 0b307d307..cb46a551a 100644 --- a/frontend/scripts/json-validation.js +++ b/frontend/scripts/json-validation.js @@ -406,17 +406,16 @@ function validateQuotes() { } const incorrectQuoteLength = quoteData.quotes .filter((quote) => quote.text.length !== quote.length) - .map((quote) => quote.id); if (incorrectQuoteLength.length !== 0) { - console.log( - `Quote ${quotefilename} ID(s) ${incorrectQuoteLength.join( - "," - )} length fields are \u001b[31mincorrect\u001b[0m` - ); + console.log("Some length fields are \u001b[31mincorrect\u001b[0m"); + incorrectQuoteLength + .map((quote) => { console.log( + `Quote ${quotefilename} ID ${quote.id}: expected length ${quote.text.length}` + )}); quoteFilesAllGood = false; - incorrectQuoteLength.map((id) => { + incorrectQuoteLength.map((quote) => { quoteLengthErrors.push( - `${quotefilename} ${id} length field is incorrect` + `${quotefilename} ${quote.id} length field is incorrect` ); }); }