Changed function to not be anonymous
Added mocha js testing