Closed kruncher closed 2 years ago
I'm not checked yet, but i guess you could use some kind of test nunjucks loader for templates. That mean that macro should be in separated files, i think it should do the trick.
https://mozilla.github.io/nunjucks/api.html#writing-a-loader
@ogonkov that worked out pretty well thank you!
For the purposes of testing it would be convenient to test if a template calls a macro with a specific set of parameters.
Is there a way to register some sort of macro override in JS which can capture the parameters of the macro call?
For example, the template might be:
And then in the unit test: