Skip to content

Instantly share code, notes, and snippets.

@Jpease1020
Forked from rrgayhart/testable-js.markdown
Last active April 4, 2016 01:13
Show Gist options
  • Save Jpease1020/49ae3ae97487fa0ac52a5274f0fe3a9a to your computer and use it in GitHub Desktop.
Save Jpease1020/49ae3ae97487fa0ac52a5274f0fe3a9a to your computer and use it in GitHub Desktop.
Writing Testable JavaScript

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).

  1. Prenestation and Interaction
  2. Data / Server Communiaction
  3. Application State
  4. Setup
  • Did any of the responsibilities that she lists surprise you?
  • Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities? So far I don't feel as though I thought about any of these principals. I was focused in getting things to work that I wasn’t aware of implementing these principals.

She also mentioned some guiding principals.

  1. use constructors to crate instances
  2. support configurability
  3. keep methods simple
  4. don’t intermingle responsibilities Still reslly learning about what some of these are and how to apply them. We used constructors to create instances in our project, We've been learning about intermingling responsibilities since day 1 in mod 1, as well as keeping methods simple but I don't really fully understand support configurability.

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