moved asserts to happen at point of test error
Added jshint, fixed code to pass with no warnings