Issue : File validation fails only in functional tests #4276
Replies: 1 comment 1 reply
-
Is there a cache or something similar? Because I went to have lunch after creating the ticket, and when I reran the tests with the 'size' line added back, it worked right away. I didn't touch anything else. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I'm developing an API with AdonisJS 5. I have a route for creating a profession. This profession comes with 2 files. I validate the data using the following validator:
When I test the POST request with the files via Postman, there are no issues.
However, when I try to do the same thing from a Japa integration test, it no longer works.
The validation fails, and I get a 422 status code.
While trying to add rules one by one, I realized that it's the size validation that is failing. Both of my files are just a few bytes, and they are the same files I use via Postman and in the test, so the problem doesn't come from there.
Here's my test (which works fine if the file size validation is not included):"
Does this ring a bell for anyone? If anyone has a solution, I'm all ears!
Thank you very much!
Beta Was this translation helpful? Give feedback.
All reactions