Testing #128
-
Looking in to "pkl:test", it seems to test expected output but it seems not to work with with validation. e.g. I have (before) this validation that happens that can get quite complex and I want to prevent regressions on it. I expect it to error when the configuration is set up incorrectly. My first guess is to make my own tooling that runs it and compares the output with a file that I make. This seems really close to what the Ideally, my end goal is to verify that my template throws errors when I want it to and does not throw errors when I do not want it to.
Note: Where validateVal is expected to either throw an error or return val |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
There are two main "modes" of
You can use |
Beta Was this translation helpful? Give feedback.
There are two main "modes" of
pkl:test
:facts: Mapping<String, Listing<Boolean>>
true
, if any are falsepkl test
exits non-zeroexamples: Mapping<String, Listing<unknown>>
- This entire property is evaluated to Pcf and stored in a.pkl-expected.pcf
file on first runpkl test
validates the output remains the same.pkl-actual.pcf
file is produced with the output andpkl test
exits non-zeroYou…