I’m in the process of completing the calculator project for the front-end development libraries certification. When I run the testing suite on my web app, I seem to fail 4/16 of the tests, but when I test these inputs manually, I seem to get the correct answer.
My intuition is that the internal state of my calculator is incorrect before the failing test is processed by the testing suite, hence resulting in incorrect answers (this seems to be verified by test 12, the output of which reads:
The expression "5 * 5.5" should produce an output of "27.5" : expected '302.5' to equal '27.5' - if my calculator’s “operation” variable is set to 5 rather than 0, on the given input, the output will in fact be 302.5 rather than 27.5). However, I’m not sure what would cause the internal state to be incorrect.
Is there any way to check the tests run before the ‘failed’ tests? I believe my output might be correct for these previous tests, but the internal state is not, causing the next test to fail.
Any help is greatly appreciated
For reference, here’s the live site: Calculator
And here’s the codebase: GitHub - lucasdmaley/calculator: Calculator project for fCC front end dev libraries certificate