Skip to content

Commit b854542

Browse files
committed
update plates support with recent changes
1 parent 6031dfa commit b854542

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lib/consolidate.js

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,14 +1272,16 @@ exports.plates = fromStringRenderer('plates');
12721272
*/
12731273

12741274
exports.plates.render = function(str, options, fn) {
1275-
var engine = requires.plates || (requires.plates = require('plates'))
1276-
, map = options.map || undefined;
1277-
try {
1278-
var tmpl = engine.bind(str, options, map);
1279-
fn(null, tmpl);
1280-
} catch (err) {
1281-
fn(err);
1282-
}
1275+
return promisify(fn, function (fn) {
1276+
var engine = requires.plates || (requires.plates = require('plates'));
1277+
var map = options.map || undefined;
1278+
try {
1279+
var tmpl = engine.bind(str, options, map);
1280+
fn(null, tmpl);
1281+
} catch (err) {
1282+
fn(err);
1283+
}
1284+
});
12831285
}
12841286

12851287

test/shared/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ exports.test = function(name) {
8686
var result = cons[name](path, locals);
8787

8888
result.then(function (html) {
89-
html.should.equal('<p>Tobi</p>');
89+
html.should.match(/Tobi/);
9090
done();
9191
})
9292
.catch(function (err) {
@@ -100,7 +100,7 @@ exports.test = function(name) {
100100
var result = cons[name].render(str, locals);
101101

102102
result.then(function (html) {
103-
html.should.equal('<p>Tobi</p>');
103+
html.should.match(/Tobi/);
104104
done();
105105
})
106106
.catch(function (err) {

0 commit comments

Comments
 (0)