custom_extension_test.js 428 B

1234567891011121314151617181920
  1. var assert = require("assert");
  2. var concat = require("concat-stream");
  3. var fs = require("fs");
  4. var hbsfy = require("hbsfy").configure({
  5. extensions: ["html"]
  6. });
  7. var templatePath = __dirname + "/custom.html";
  8. fs.createReadStream(templatePath)
  9. .pipe(hbsfy(templatePath))
  10. .pipe(concat(function(data) {
  11. assert(
  12. /hbsfy compiled Handlebars template/.test(data.toString()),
  13. "The template should be compiled"
  14. );
  15. }));