Tag: javascript

Set up your React environment with npm, babel and webpack

A castle built of cardboard boxes, with the react logo like a rising sun in the background.

In my last tutorials, we used the handy create-react-app package to set up our React app for us. I propose that we go a little more into the details and make our own setup from scratch.

(more…)

Learn React State Hook by building a memory game

React Hook reveals a snake from a memory game card.

React offers a simple and efficient way to structure our application through function components. In this tutorial we will see how to make these components ‘react’ to the user actions by using the State Hook.

(more…)

Test Driven Development, a practical start

Automated testing, sometimes clumsily referred as unit testing (because unit tests are a part of the broader concept of automated tests), is a practice in development in which I’m really interested. Its point is to have code that inspect your code, to see if the former behave like you expect. While it obviously makes you write more code, its goal is to pay back the time you’ve invested into writing your test code by helping you discovering the bugs you may introduce during your development iterations.

More specifically, what I will demonstrate in this post is how to start using a quite rigorous approach of this practice which is called Test Driven Development. This specific way of thought advocates to write your tests before you start writing your production code. This might seems a little weird when you hear about it the first time, because you will basically be testing something that doesn’t exist yet. So I will use a practical case where I implemented it to let you understand how it works and how it benefited me.

(more…)