mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
23 lines
685 B
JavaScript
23 lines
685 B
JavaScript
var nodePath = require('path');
|
|
var fs = require('fs');
|
|
|
|
exports.check = function(marko, markoCompiler, expect, done) {
|
|
var compiledPath;
|
|
|
|
require('marko/compiler').configure({
|
|
writeToDisk: true
|
|
});
|
|
|
|
try {
|
|
var templatePath = nodePath.join(__dirname, 'template.marko');
|
|
compiledPath = nodePath.join(__dirname, 'template.marko.js');
|
|
var template = require(templatePath);
|
|
delete require.cache[templatePath];
|
|
expect(fs.existsSync(compiledPath)).to.equal(true);
|
|
expect(template.renderSync({name: 'Frank'}).toString()).to.equal('Hello Frank!');
|
|
} finally {
|
|
fs.unlinkSync(compiledPath);
|
|
}
|
|
|
|
done();
|
|
}; |