Michael Rawlings 4a73060bc6 Cleanup tests (#1341)
Cleanup tests and add assertions that all deprecated tests log warnings, and all non deprecated tests don't.
2019-05-28 10:54:31 -07:00

31 lines
848 B
JavaScript

var nodePath = require("path");
var fs = require("fs");
exports.check = function(marko, markoCompiler, expect, snapshot, done) {
markoCompiler.configure({
writeToDisk: false
});
var templatePath = nodePath.join(__dirname, "template.marko");
var template = marko.load(templatePath);
snapshot(template.renderSync({ name: "Frank" }).toString());
markoCompiler.configure({
writeToDisk: false
});
var compiledTemplatePath = nodePath.join(__dirname, "template.marko.js");
var compiledIncludeTemplatePath = nodePath.join(
__dirname,
"include-target.marko.js"
);
expect(fs.existsSync(compiledTemplatePath)).to.equal(false);
expect(fs.existsSync(compiledIncludeTemplatePath)).to.equal(false);
// Revert back to defaults
markoCompiler.configure();
done();
};