Route Validator rules ignored during HTTP tests

Hi guys,

The rules defined in my Validator are being ignored during HTTP tests, but work perfectly using e.g. Postman.

Quick note upfront: I just started using adonis 4.1.


// routes.js
  .post('auth/login', 'AuthController.login')

// Auth/Login.js
  get rules () {
    return {
      username: 'required',
      password: 'required'

// auth.spec.js test
const { test, trait } = use('Test/Suite')('Auth')

const response = await client
      username: user.username,

What am I doing wrong?
Thanks :slight_smile:

1 Like

Try to set request content type to json

What is your response returning if you inspect / log it out?

1 Like

pay attention if you are sending a user even in this:
it may be that it is not correct, if it is an app try to personalize the messages is easier to identify.

1 Like