how do I mock error conditions in unit tests? #2443
-
Follow up question based on: #2442 (comment) Is there a way that I can simulate errors with the test framework for existing components, so I can make sure that the pipeline works as expected? |
Beta Was this translation helpful? Give feedback.
Answered by
mihaitodor
Apr 1, 2024
Replies: 1 comment 2 replies
-
Hey @smousa 👋 Sure! You can use mocking and have |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
smousa
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hey @smousa 👋 Sure! You can use mocking and have
mapping: 'root = throw("your specific error")'
. For example, you could domapping: 'root = throw("key does not exist")'
to simulate a cache miss.