I am a fan of test driven development (TDD). I am a fan of React. I wanted to find a framework that made dealing with states easier.
I heard a lot about redux and wanted to go trough Dan Abramovs tutorial, Egghead - Redux tutorial, using TDD.
Each commit corresponds to one episode with the same message as that episodes title. There are tests written to each new feature in every commit.
To make it easier to write tests i have not used a single js-file. I have instead extracted some functionality a little bit too early that was intended by Dan in to own files, but it's pretty straight forward what i have done.
If you haven't used wallaby.js, do it! Its an amazing tool if you want to get fast feedback in real time when writing unit tests for javascript.
git clone https://github.com/Knegusen/redux-tutorial.git
Execute:
$ npm install
Run the following command to enable React Hot Reloading:
$ npm start
It will start a minimal webpack-dev-server that listens for changes in your react components.
$ npm test
Configure Wallaby for one of the supported IDEAs.
Open:
Run -> Edit Configurations..
Then add new configuration by clicking +
, name it Wallaby, and browse for the wallaby.js
file that resides in the root directory of the repository.