FCC Speedrun — Calculator

If you don’t know what FCC Speedrun is — here is a link to a GitHub repo.

First one of the “advanced” frontend projects (according to FCC’s curriculum).

You can check the live version of it here and the source code here (run out of time to add styling).

To make this project more challenging and to learn more about testing React components, I decided to continue to focus on writing tests.

First thing was to make a sketch which will show the structure of components. Inkscape is a perfect tool for that.

After that I used the TDD (Test Driven Approach) to write the components — first I wrote the test which will describe the component’s structure and only after that I wrote the component itself, starting from the smallest (Key) and moving on to the bigger components. I can say that I succeeded — I managed to write the whole app without rendering it once, except at the end to add some styling and fix divide-by-zero-bug 😒.

Uncovered lines is the bugfix I added at the end (I was in a hurry to finish, at the end of the day this is a speedrun 😎):

Overall I found it interesting and fun and I think I’ll try this coding-without-rendering for the next projects also.

My progress in the Speedrun thus far:

Thank you for your attention and happy coding 🤓

Show your support

Clapping shows how much you appreciated Viktors Jenovs’s story.