custom_extension_subargs_test.js 503 B

12345678910111213141516171819
  1. var hbsfy = require("hbsfy");
  2. var concat = require("concat-stream");
  3. var assert = require("assert");
  4. // Subargs are just passed as the second argument
  5. // https://github.com/substack/node-browserify/blob/5cbf55a4397f300df69be574b59f3f30ac01b9c2/bin/advanced.txt#L81-L90
  6. var tr = hbsfy("foo.html", { extensions: "html" });
  7. tr.pipe(concat(function(data) {
  8. assert(
  9. /hbsfy compiled Handlebars template/.test(data.toString()),
  10. "File was compiled"
  11. );
  12. }));
  13. tr.write("hello {{bar}}");
  14. tr.end();