Route not authenticated but still my test fails


When I have this: => {                                                                                                                              
  Route.resource('users', 'UserController')                                                                                                

My test goes well:

test('No auth here', async( { client } ) => {                                                                                                    
  const response = await client.get(`${apiVersion}/users`).end()                                                                              

But I want to authenticate some routes only, the test fails (I get 500 instead of 200): => {                                                                                                                              
  Route.resource('users', 'UserController')                                                                                                
  .middleware(new Map([                                                                                                                            
    [['store', 'update', 'destroy'], ['auth']]  

Why my test fails?


500 status code means there is an Internal error and not an authentication error. What make you come a conclusion that authentication is making the test fail?

Also simply log response.error to see what the error is