mkjs / talks

Open an issue to submit a talk https://github.com/mkjs/talks
5 stars 0 forks source link

Writing good unit tests #22

Closed sean-ww closed 7 years ago

sean-ww commented 7 years ago

It would great to see some examples of real world unit tests, and to understand where they have been useful. (I'm an absolute beginner at writing unit tests, so it would be great if someone all powerful could share their wisdom and present this)

jamescoward commented 7 years ago

Hi @sean-ww thanks for the suggestion! We'll see what we can organise 👍

jamescoward commented 7 years ago

Hi @sean-ww we've decided to try out a new thing next event where we will have a group discussion instead of a second talk. I think we will get some good input from the community :)

sean-ww commented 7 years ago

OK, that should be good thanks.

jamescoward commented 7 years ago

I'll still keep a look out for someone who could give a talk on the topic as well.

davidjgoss commented 7 years ago

So, I thought we could post links here related to some of the bits and pieces we talked about, and people can weigh in with stuff and/or ask questions in the comments.

To start with, someone mentioned the practise of having tons of unit tests because they're cheap and fast, and fewer e2e tests because they have a higher cost. I've heard this talked about as part of the "testing pyramid" (predictably Martin Fowler has a good article on it) and also found this post interesting about the "cupcake" shape that is unfortunately more familiar to lots of teams.

davidjgoss commented 7 years ago

Also some links to JS testing libs/frameworks we mentioned:

Also I spotted this one a while ago which looks really awesome https://github.com/avajs/ava

jamescoward commented 7 years ago

To add to that