Unhandled promisse rejection on a test

Hey, I have an user test to show the information of an user given id, but I’m facing an warning on console, can some one help me to find out what it means? it is a very simple method :s below I show all code involved.

the test it self.


The method it is hitting

The warning

The factory that creates the user.
Screen Shot 2020-03-20 at 10.06.41

  1. Next time, please paste the code snippet and format as “preformatted text.” It is easily to make corrections to the snippet that way.
  2. Wrap your async codes in a try_catch block so that you can intercept errors. That’s the reason for the warning.
    E.g.
try {
   ...
   const user = await User.findOrFail(id);
   ....
} catch(error) {
   console.log(error)
}

Or

try {
   const user = await Factor.model("App/Models/User").create();
   const reponse = await client
   ....
} catch(error) {
   console.log(error)
}
1 Like

I’ll will send the code next time, thanks.

I’ve done that as well and the error persists, It is only happening in one test. Asap I’ll put the code right way here, thanks again for you time :slight_smile:

We were discussing it in Discord, but did you get it solved in the end?
What was the issue, can you post it in here too? (In case you got it solved)

If not can you refresh my memory what we discussed / tried in Discord chat?