intuit / judo

Judo is an easy-to-use Command Line Interface (CLI) Integration Testing Framework, driven from a simple yaml file that also contains assertions.
Other
51 stars 21 forks source link

43 - Reusable variables using mustache #47

Closed nicomt closed 3 years ago

nicomt commented 4 years ago

The documentation shows simple variable substitution (more advanced things can be done with mustache). This can be used in combination #46 to import variables from fragments in multiple test scenarios in the same folder

nicomt commented 4 years ago

@worldjoe Thanks for merging #46! (Sorry I missed the package-lock.json).

Related to this PR, I created this library for a project that I'm working on. It can be used to solve #43 too and it has some advantages over mustache like fallback defaults and simple escaping (in mustache escaping curly braces is really ugly).

command: echo "{{=<% %>=}}{{escapedCurly}}<%={{ }}=%>"

The new library seems to perform well in my tests but is obviously not battle-tested like mustache. If you're interested, I can write another PR using that library instead of mustache?

Anyway, I updated this PR, so it should be able to merge if you prefer this implementation

worldjoe commented 3 years ago

This is great.