Proving out JS pre/post conditions

I created a gist based on my thoughts around pre/post conditions. It could definitely be simplified further, but I like the idea of separating out the validation like this.