This repository has been archived by the owner on Sep 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New method for testing, we create both jade and html templates and
we check if the `.render` method is identical
- Loading branch information
1 parent
56c4a29
commit 57fbbff
Showing
7 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template name="match-html-htmlarg"><p id="{{paragraphId}}"></p></template> | ||
|
||
<template name="match-html-inclusionwithargs">{{> myTemplate arg1=arg1 arg2=arg2}}</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
template(name="match-jade-htmlarg") | ||
p(id=paragraphId) | ||
|
||
template(name="match-jade-inclusionwithargs") | ||
+myTemplate arg1=arg1 arg2=arg2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
var tests = { | ||
'htmlarg': "it should interpolate expressions inside html arguments", | ||
'inclusionwithargs': "it should include the template with arguments" | ||
}; | ||
|
||
Tinytest.add('Jade - Compiled template match Spacebars', function (test) { | ||
_.each(tests, function(desc, name) { | ||
var jadeTpl = Template[["match", "jade", name].join("-")]; | ||
var htmlTpl = Template[["match", "html", name].join("-")]; | ||
test.equal(jadeTpl.render.toString(), htmlTpl.render.toString(), desc); | ||
}); | ||
}); |
File renamed without changes.
File renamed without changes.