FCC Speedrun — Twitch Client

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

With this project I finally decided to dig into testing. As I’m new to React testing and this is speedrun, I kept the project as simple as possible.

You can check the live version of it here and the source code here.

If you visit FCC’s forum somewhat regularly, you know that Twitch Client project is not very popular among campers. I think there are few reasons, but one of them is definitely frequent API changes. And guess what — they did it again 🙂 (nothing too radical however).

But my main focus of this project was testing.

Stack used: Enzyme, Mocha, Chai, Sinon. I usually use mjackson’s Expect instead of Chai and it took me a while to get used to the different syntax (Chai seems to be preferred choice among people using Enzyme).

My thoughts about testing? It really makes you think about how you structure your project — I rewrote my components like ten times before I was able to create reasonable tests (and then I rewrote those tests like ten times). I didn’t manage to get 100% coverage, but I was close:

Still need to look into mocking/spying/stubbing Ajax calls, but I think I’ll leave it for another project.

I also tried different folder structure this time:

Each component has its own folder with component itself, tests and styling. Honestly I like it much better — you need to keep only one or two expanded folders which is much more easier to navigate. Also this structure makes reusing of components very easy — you just copy/paste the whole folder.

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.