-
Notifications
You must be signed in to change notification settings - Fork 211
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Red logs [error] {:error, :invalid_file} in test environment #268
Comments
@williamweckl I see
in my tests and I think it's arc_ecto printing that error here. Here's what I'm calling instead of
|
@williamweckl can you verify if your current tests are using fake files, or nonexistent files? I haven't run into this, but I also usually do something like |
@dbernheisel I am using invalid extension files on purpose to test validations. |
gotcha. You might want those logs to appear in real logs then, but not in tests. right? If so, then what I do to suppress those log outputs is to use ExUnit.CaptureIO and either swallow the logs, or assert the output. |
@dbernheisel that's the exact behavior I'm expecting :) Could this be the default for the lib? In earlier versions this logs was not shown. |
As an example of this for future people who find this thread (as I did), you can do something like the following. In our case, the line
was throwing an
we were able to wrap the test body in |
Environment
Actual behavior
In my unit tests, when I'm testing arc validations using invalid file types my logs shows
[error] {:error, :invalid_file}
. All the tests passes but this logs are unnecessary in test environment and gives a false feeling that something is wrong. I'm noticing it since version 0.9.Expected behavior
Not showing this logs when I'm running application in test environment.
The text was updated successfully, but these errors were encountered: