Added test to make sure next is defined prior to calling
Updated mocha and expect.js versions