Skip to content

Commit

Permalink
CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ospfranco committed Nov 18, 2024
1 parent 1b30cdd commit 4844bdf
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions scripts/poll-in-app-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)}`);
}
Expand Down

0 comments on commit 4844bdf

Please sign in to comment.