From 4844bdf8ae650b37cbea7a88832e0f8089d6e025 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Mon, 18 Nov 2024 18:59:46 +0700 Subject: [PATCH] CI --- scripts/poll-in-app-server.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/scripts/poll-in-app-server.js b/scripts/poll-in-app-server.js index b0c508f9..52d4e68a 100644 --- a/scripts/poll-in-app-server.js +++ b/scripts/poll-in-app-server.js @@ -10,16 +10,19 @@ async function pollInAppServer() { const response = await makeHttpRequest('http://127.0.0.1:9000/results'); if (response !== null) { - let parsed_response = JSON.parse(response); - const allTestsPassed = parsed_response.results.reduce((acc, r) => { + let parsedResponse = JSON.parse(response); + const allTestsPassed = parsedResponse.results.reduce((acc, r) => { + console.log(r.description); return acc && r.type !== 'incorrect'; }, true); if (allTestsPassed) { - console.log('🟒🟒🟒🟒🟒 All tests passed!'); + console.log( + `🟒🟒🟒🟒🟒 ${parsedResponse.results.length} tests passed!` + ); process.exit(0); } else { - parsed_response.results.forEach((r) => { + parsedResponse.results.forEach((r) => { if (r.type === 'incorrect') { console.log(`πŸŸ₯Failed: ${JSON.stringify(r, null, 2)}`); }