31

Really not that much information out there on this subject.

I gather Jest would be the Facebook recommended test environment and obviously there are plenty of other testing frameworks which is irrelevant as I'm trying to obtain a list of TDD/BDD examples in React.js.

Does anyone have tutorials / videos / repos / slides to help others and my self learn how TDD/BDD would be accomplished with React.js?

This Question has been put on hold due to being "off-topic", did feel it would help lots of people and is a very good question but some (non react members) feel that's not the case.

So instead of killing this question off!! I've started a Git Repo and put the list of links we have so far + others that have been contributed on there. If anyone would like to contribute please send PR or add in comments bellow I'll keep adding them to the list.

TDD / BDD React REPO

cmdv
  • 1,693
  • 3
  • 15
  • 23
  • 1
    I've been working recently on [this series](http://davintryon.blogspot.co.uk/2015/06/test-driven-react-with-karma-and-webpack.html). Next post will cover TDD with karma on React components. – Davin Tryon Jul 10 '15 at 10:20
  • look forward to seeing it, add link to answers when done if you could – cmdv Jul 10 '15 at 10:38
  • I agree with @DavinTryon, karma/mocha is a better route than Jest at the present time. – James Jul 10 '15 at 12:07
  • 6
    Also, I'm really sad to see that Stack really is becoming the hostile place described in news media recently. This seems like a perfectly valid question, the type of question I used to come to Stack to find answers for all the time. – James Jul 10 '15 at 12:09

1 Answers1

22

Those helped me get started:

Also worth looking at Shallow Rendering

Nathan Tuggy
  • 2,237
  • 27
  • 30
  • 38
knowbody
  • 8,106
  • 6
  • 45
  • 70
  • 1
    Jest has some [examples](https://github.com/facebook/jest/tree/master/examples) as well. Also here some more https://github.com/enaqx/awesome-react#testing-react-tutorials – knowbody Jul 10 '15 at 10:50
  • 2
    I wrote the "Using Test Driven Development with React.js to Add..." (what a mouthful) article. Jest is great, but it is very limiting for many purposes. Like most people using React in production, we ended up switching to Mocha. I'm actually working on a writeup on using Mocha with Karma for better testing, https://github.com/HurricaneJames/react-item-box-input (see the writeup.part*.md files). The writeup is not complete, but it will give you an idea of some of the techniques we used for better testing. I'm planning to go back to that article when I'm done playing with GraphQL. – James Jul 10 '15 at 12:05
  • I've started a git repo as this has now been put on hold as it's off topic. will add you tutorial there =) [github repo](https://github.com/Cmdv/essential-tdd-bdd-react-list) – cmdv Jul 10 '15 at 12:09