Port authenticate middleware test cases to mocha.