-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest.js
More file actions
34 lines (22 loc) · 699 Bytes
/
test.js
File metadata and controls
34 lines (22 loc) · 699 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
var assert = require('assert')
var your_function = require('./index');
var tpl = your_function("hello {{ world }} how\n is your {{ weekday }} going?")
var result = tpl({
world: 'dude'
, weekday: 'tuesday'
}) // == "hello dude how is your tuesday going?"
assert.equal( result, "hello dude how\n is your tuesday going?")
var tpl = your_function("i have five cherr{{ plural }}" )
var result = tpl({
plural: "ies"
}) // == "i have five cherries"
assert.equal( result, "i have five cherries", "These should match")
var tpl = your_function("{{ check.it.out }}" )
var result = tpl({
check:{
it:{
out: "woop woop"
}
}
}) // == "woop woop"
assert.equal( result, "woop woop")