• Stars
    star
    594
  • Rank 75,329 (Top 2 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 9 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A series of examples on how to TDD React

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.

More Repositories

1

karma-mocha-chai

Skeleton setup for a bare project using karma with mocha and chai.
JavaScript
24
star
2

idle-maps

Google maps react components
JavaScript
21
star
3

thoughtsom

Save thoughts and watch them get organized.
JavaScript
18
star
4

async-google-maps

Asynchronous loading and creation of google maps
JavaScript
16
star
5

yadda-karma-example

An example of running yadda tests with karma
JavaScript
8
star
6

local-openfaas-workbench

A simple way to bootstrap a local OpenFaaS environment
8
star
7

coffee-hunt

I love coffee. Show me where I can get some.
JavaScript
5
star
8

kube-playground

Hacking with kubernetes, graphql, and maybe some other stuff
Shell
3
star
9

jig

Tired of making sure that everyone has the correct tools installed on their machine
Go
3
star
10

react-cucumber-js

An example of how to write acceptance tests against a react application.
JavaScript
3
star
11

lousy-list

A quasi catalog of my mind
3
star
12

xvfb-karma-chrome

A headless vagrant environment for using the karma test runner with a headless chrome instance.
Puppet
3
star
13

spike-playground

Experimenting with react as the view layer for backbone.
JavaScript
2
star
14

koozie-exporter

Track idea to production, without the sweat
Go
2
star
15

react-google-maps-example

Example of building React components for use with Google Maps
JavaScript
2
star
16

webapp-workshop

How to build a web app .. with tests
JavaScript
1
star
17

fake-rest-api

A set of endpoints that serve fake data for testing api client interactions.
JavaScript
1
star
18

discover-js

Discover javascript projects on GitHub
JavaScript
1
star