GithubHelp home page GithubHelp logo

zpratt / react-tdd-guide Goto Github PK

View Code? Open in Web Editor NEW
597.0 15.0 34.0 585 KB

A series of examples on how to TDD React

License: MIT License

JavaScript 100.00%
tdd javascript react howto guide jest tutorial

react-tdd-guide's Introduction

react-tdd-guide

A series of examples on how to TDD React

Getting started

  1. install nvm
  • Grab an editor or IDE. I recommend Webstorm, Atom, and VIM, in that order.
  • git clone ...
  • nvm install 4 OR if v4 of node.js is installed, nvm use
  • npm i

How to use this guide

Each section is broken out into its own folder, starting with basics. What you'll find there is the finished example. I am experimenting with using the commit history and comments to drive the guide itself. Feedback on whether this works or not would be appreciated.

Each commit that is suffixed with "- red" can be checked out separately to examine the failing test. Each commit that is suffixed with "- green" shows how I finally passed the failing assertion.

Looking at the history for each section will show you only the steps needed to drive that part of the application.

Philosophy

Table of Contents

  • Basics - Steps for TDD'ing the simplest of React components: An unordered list of items. Start here if you're not familiar with TDD'ing React and want to see a simple introduction.
  • Simple event handling (WIP)
  • Simple stateful input
  • Centralized state management techniques (not done)
  • Redux (not done)
  • React router (not done)

Running the tests for a section

  • npm run <section name>

Running all tests

  • npm test

Contributing

Please feel free to open an issue for:

  • A question on how to do something
  • A request for further clarification

Use a pull request for

  • Suggestions on changing how something is tested
  • To add an example you think would be valuable

Caveats

I am not a windows user, therefore this has only been tested on OSX.

react-tdd-guide's People

Contributors

antouank avatar rcoy-v avatar travi avatar zpratt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

react-tdd-guide's Issues

Add a change log to keep track of URIs/commits

Hi Zach,

Great guide :) I really like the way you're using commits to document stuff, very clever! Let's see how inline commenting on those plays out.

Have you thought about adding a change log and applying some versioning/tagging scheme?
That would give you, on a per commit basis, the ability to build up a list of snippets with their solution. Tagging would also make it easier to reference the code in an easier to read way.

Darío

Add a Travis CI build

Since this repo is about tdd, it would be a good example to also show CI that runs tests on every push.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.