Skip to content

Commit

Permalink
Add test for Swig template compile
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Feb 27, 2016
1 parent 6e81ff7 commit f7d516e
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/scripts/renderers/swig.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,18 @@ describe('swig', function() {

r({text: body}, data).should.eql('123');
});

it('compile', function() {
var body = [
'Hello {{ name }}!'
].join('\n');

var render = r.compile({
text: body
});

render({
name: 'world'
}).should.eql('Hello world!');
});
});

0 comments on commit f7d516e

Please sign in to comment.