mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
29 lines
546 B
JavaScript
29 lines
546 B
JavaScript
var nodePath = require("path");
|
|
var through = require("through");
|
|
|
|
exports.check = function (marko, markoCompiler, expect, snapshot, done) {
|
|
var output = "";
|
|
|
|
var stream = through(function write(data) {
|
|
output += data;
|
|
});
|
|
|
|
stream
|
|
.on("end", function () {
|
|
snapshot(output);
|
|
done();
|
|
})
|
|
.on("error", function (e) {
|
|
done(e);
|
|
});
|
|
|
|
var template = marko.load(nodePath.join(__dirname, "template.marko"));
|
|
template
|
|
.stream({
|
|
$global: {
|
|
foo: "bar",
|
|
},
|
|
})
|
|
.pipe(stream);
|
|
};
|