You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be good to have a "any" value comparison which we have in some of the Unit Test frameworks like XUnit. If I want to compare a value (lets say integer) set in the Values.yaml file and compare the output inside my template file to the expected value (e.g: + 10). It should be something like the one below :
The problem with asserting hardcoded values in the test file is that someone can bypass the unit test failure by setting a hardcoded value in the template instead of reading it from Values.Yaml
The text was updated successfully, but these errors were encountered:
I'm not familiar with the any value in testing frameworks as part of assertions, only within mocks.
What are you trying to validate in the unittest?
The goal of the unittest plugin is to validate the expected behaviour of the template being generated, not if a user or application has set a specific value in the values file.
In your case i would suggest to have two tests, one validating the original value in the values.yaml and the second to validate the overriden value.
The other option is already described by yourselves, by using the matchRegex assertion.
It would be good to have a "any" value comparison which we have in some of the Unit Test frameworks like XUnit. If I want to compare a value (lets say integer) set in the Values.yaml file and compare the output inside my template file to the expected value (e.g: + 10). It should be something like the one below :
Values.yaml
resource_test.yaml
The problem with asserting hardcoded values in the test file is that someone can bypass the unit test failure by setting a hardcoded value in the template instead of reading it from Values.Yaml
The text was updated successfully, but these errors were encountered: