You can test what has been output to standard console during Masonite unit tests thanks to useful console assertions.
Output here is the standard output often named stdout
. Error here is the standard error often named stderr
.
External packages, prints in your code can output content in console (as output or error).
If you want to assert content output by a Masonite command you should use Commands Tests assertions instead.
The following assertions are available:
Assert that nothing has been printed to the console.
Assert that something has been printed to the console (output or error).
Assert that console standard output is equal to given output.
Assert that console standard output contains given output.
Assert that console standard output does not contain the given output.
Assert that something has been output to console standard error.
Assert that console standard error is equal to given error.
Assert that console standard error contains given error.