Skip to content

Commit da9aaa7

Browse files
committed
add a unit test to address a bug in the underscore engine
1 parent 547c565 commit da9aaa7

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test/engine_underscore_tests.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,17 @@ exports['engine_underscore'] = {
7272
// test
7373
test.equals(helloWorldWithData.render(), 'Hello world!' + eol + 'Yeah, we got the subtitle from the JSON.' + eol);
7474
test.done();
75+
},
76+
'findPartial return the ID of the partial, given a whole partial call': function (test) {
77+
var engineLoader = require('../core/lib/pattern_engines');
78+
var underscoreEngine = engineLoader.underscore;
79+
80+
test.expect(1);
81+
82+
// do all the normal processing of the pattern
83+
// test
84+
test.equals(underscoreEngine.findPartial("<%= _.renderNamedPartial('molecules-details', obj) %>"), 'molecules-details');
85+
test.done();
7586
}
7687
};
7788

0 commit comments

Comments
 (0)