Skip to content

Commit

Permalink
Merge pull request #156 from cgc/fix-jade-includes
Browse files Browse the repository at this point in the history
Fix jade includes
  • Loading branch information
ixti committed Jul 12, 2014
2 parents a2f2850 + a6d1d3b commit 4fc1387
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/mincer/engines/jade_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ JadeEngine.prototype.evaluate = function (context, locals) {

this.data = compile(this.data, _.extend({}, options, {
client: true, // needed only for Jade < v1.0.0
filename: context.logicalpath
filename: context.pathname
})).toString();
return;
}
Expand Down
10 changes: 10 additions & 0 deletions test/engines_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ describe('Engines', function () {
assert(asset.toString().match(/buf\.push/));
});
});

describe('JADE', function () {
it('should compile to a JS function', function () {
var asset = env.findAsset('jst_engine/jade/template');
assert(asset.toString().match(/this\.JST/));
assert(asset.toString().match(/buf\.push/));
assert(asset.toString().match(/template/));
assert(asset.toString().match(/included/));
});
});
});

});
1 change: 1 addition & 0 deletions test/fixtures/jst_engine/jade/included.jst.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
| included
3 changes: 3 additions & 0 deletions test/fixtures/jst_engine/jade/template.jst.jade
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
div
| template
include ./included.jst.jade

0 comments on commit 4fc1387

Please sign in to comment.