Testing
Last updated
Was this helpful?
Last updated
Was this helpful?
FLAT provides a built-in test framework. It is especially useful to unit-test , error handling and upstream requests.
FLAT tests are defined as files with the root node flat-test
. There are a couple of specialized that accompany the test flow. The invocation of at least one is mandatory.
Test files can be stored anywhere inside the FLAT app directory. We recommend creating a tests/
folder next to swagger.yaml
.
FLAT tests are started with the command test
:
If all tests pass, the exit code is 0
. If any test fails, the code is non-zero (1
). Therefore, in deployment scripts or Makefile
recipes (both of which are usually executed as set -e
) you can rely on the exit code to fail the process.
The test result is printed in format:
(cookbook)
(cookbook)
(cookbook)
(reference)
(reference)
(reference)
(reference)
(reference)