Calculator unit tests unexpectedly fail

Hey everyone,

It would seem like I have finished the calculator project for the Front-end libraries certificate. When I test it manually, my calculator produces all of the correct answers.

For example:
10.5 - 5.5 = 5

For some reason, however, 5/16 unit tests still return assertion errors despite the manual use of my calculator producing the correct answer in all 5 of those cases.

What could be going wrong? For reference, here is my GitHub repo for this project.

Hello and welcome back to the FCC community~!

Do you happen to have a link to a live version of your calculator app? :slight_smile:

Hey nhcarrigan, thank you for the response :sunglasses: Not yet, I just have the repo for now. Let me search for how to deploy my repo to GitHub Pages.

I’ve deployed my app now here:

Okay, so I tried the 10.5-5.5 and clicking the = button does not seem to do anything.

It looks like clicking the = calls the handleSetIsCalculating function to set the state to true, but it isn’t calling the handleCalculations function (which, from looking at your code, is what you want it to call?)

I’m not very proficient with React but this is what I am seeing.

Thanks a lot for your help! I changed some things up and a couple days later I’ve now gotten all 16 test cases to pass! :sunglasses:

Congratulations~! Make sure to take some time to celebrate your success :smiley:

1 Like