Skip to content

Instantly share code, notes, and snippets.

@emilyfreeman
Forked from rrgayhart/unit-testing-javascript.md
Last active February 25, 2016 19:16
Show Gist options
  • Save emilyfreeman/2a5d26f9fd4604309d99 to your computer and use it in GitHub Desktop.
Save emilyfreeman/2a5d26f9fd4604309d99 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?
    • Presentation and Interaction, Data/Server Communication, Application State and Setup
    • Prior to watching this, I wouldn't have been able to list these four responsibilities, but looking at them, it makes perfect sense. It's not unlike MVC and pushing logic down the stack. Setup is the only one that surprised me because it's a little different than what we've done in the past, but still makes sense. I think setup may be the trickiest responsibility to separate out.
  • Do you feel like you mentally split your client side code in IdeaBox and other past projects into these responsibilities?
    • Nope! I had one big $(document).ready that took care of everything and all my logic, views and server communication were in the same .js file.

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

@rrgayhart
Copy link

👍

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