Javascript calculator - too slow and not passing tests!

Hello!

I am a little bit at my wits end with the JS Calculator project - it performs exactly as it is supposed to however does not pass all the tests.

I have narrowed down as to why: I included Redux because I wanted to use all the technologies I could in order to build my understanding - obviously it is incredibly overcomplicated and wouldn’t be needed in real life. This has an impact on the tests because when the test suite simulates the button clicks and then reads the content of the display, the display hasn’t caught up - the content is still going back and forth to the Redux store.

The delay is not noticeable to the human eye, but I have verified this by adding a test button which simulates clicks on the one, two and three buttons, and then logs the display contents to the console. This always logs the content of the display as it was before 123 was clicked.

How can I speed up the execution of the code so that the test pass, or indeed slow the tests down? Is it a question of removing the Redux element from the equation entirely?

Compiled code: React App
Repo: GitHub - georgegebbett/fcc-calculator

Any thoughts are welcome and I would be so grateful for any advice

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.