MCPcopy
hub / github.com/twigjs/twig.js / run

Function run

test/test.async.js:139–145  ·  view source on GitHub ↗
(tpl, result)

Source from the content-addressed store, hash-verified

137 describe('Twig.js Control Structures ->', function () {
138 it('should have a loop context item available for arrays', function () {
139 function run(tpl, result) {
140 const testTemplate = twig({data: tpl});
141 return testTemplate.renderAsync({
142 test: [1, 2, 3, 4], async: () => Promise.resolve()
143 })
144 .then(res => res.should.equal(result));
145 }
146
147 return Promise.resolve()
148 .then(() => run('{% for key,value in test %}{{async()}}{{ loop.index }}{% endfor %}', '1234'))

Callers 1

test.async.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected