How to unit test data validation at rest level #10311
Unanswered
tokidoki11
asked this question in
Q&A
Replies: 1 comment
-
I think acceptance tests are the way for testing the schema validation. Here are some examples testing schema validation by expecting 422 (Unprocessable Entity, so most probably schema validation failure) as response code: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
https://loopback.io/doc/en/lb4/Validation-REST-layer.html
As you may already know loopback 4 embed ajv validation for schema on rest layer
I am wondering how to create unit test so i can ensure the validity of my settings
https://loopback.io/doc/en/lb4/Testing-your-application.html#unit-test-your-controllers
i think the request model validation unit test should be run on controller unit
But i cant find any example of doing so
Beta Was this translation helpful? Give feedback.
All reactions