comp426-2022-fall / a02

Create a command line Node.js package that ingests API data from Open-Meteo
GNU Affero General Public License v3.0
0 stars 0 forks source link

Autograder: Nearly identical tests failing #12

Closed bdhack23 closed 1 year ago

bdhack23 commented 1 year ago

For some reason my "galosh.js today" autograder test is failing but the "galosh.js tomorrow" one is not, despite testing for very similar things. I cannot figure out what is wrong with my if-else statement for today's weather. It is also worth mentioning the test called "Today weather" is also not passing, so this really seems to be something wrong with just today specifically. In my if-else statement for today, I check to see if days == 0, and then if the precipitation sum for day 0 is greater than 0(indicating rain). Else, you won't need your galoshes as there wouldn't be any rain for today. What is going wrong? This seems like the correct logic...

smelliskay commented 1 year ago

Looking through your code, you have complicated things for yourself with some redundant logic. You are logging "You will not need your galoshes" and "You might need your galoshes" in every step of your if() {} elseif () {} else{} blocks. Try removing this entirely or writing it to stdout instead (outside of the if elseif else blocks).

Note: Writing to stdout would look like this

process.stdout.write("You might need your galoshes ");

Fiddle with this some more and if you are still having trouble comment back.