Skip to content

Instantly share code, notes, and snippets.

@MattRooney
Forked from rrgayhart/unit-testing-javascript.md
Last active February 12, 2016 03:42
Show Gist options
  • Save MattRooney/ba292892fdd0efdbc1ee to your computer and use it in GitHub Desktop.
Save MattRooney/ba292892fdd0efdbc1ee to your computer and use it in GitHub Desktop.

Step One: Watch Writing Testable JavaScript - Rebecca Murphey from Full Frontal 2012 (award for worst conference name ever?)

Step Two: Fork this gist.

Step Three: Consider the four responsibilities that Rebecca lists for client side code (hint: they're color coded).

  • Did any of the responsibilities that she lists surprise you?
  1. presentation & interaction
  2. data/server communication
  3. application state
  4. setup

Setup is surprising off the bat, but all four make sense now. And they immediately make me consider how convoluted my first bits of JS were and how, going forward ,I need to really think about the design and structure of my code.

  • Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?

I definitely have not thought of my client side code this way. I’ve approached client side code more from, as she said, the refresh refresh refresh angle. which doesn’t give me very helpful errors.

Step Four: Totally Optional: take a look at some of the other forks and comment if the spirit moves you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment