Skip to content

Instantly share code, notes, and snippets.

@rossedfort
Forked from rrgayhart/unit-testing-javascript.md
Last active February 26, 2016 16:49
Show Gist options
  • Save rossedfort/a97b70dc0542cfce7473 to your computer and use it in GitHub Desktop.
Save rossedfort/a97b70dc0542cfce7473 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?

    The part about application state surprised me a little bit, because it is not something I usually think about while writing client side code. It's not that I don't know it's a very important factor of client side code, it's just that I don't usually realize how it ties in to my application. For me, 'state' is an ambiguous concept that I don't fully understand.

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

    I think I did an OK job at splitting my client side code into these responsibilities. I tried to keep all of my ajax calls in separate functions, and use the promise syntax to call the functions in charge of adding the data to and html template and rendering the template on the page. I definitely think I could have done better with application state and setup.

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