{"size": 1338, "ext": "js", "max_stars_repo_path": "test/comment.js", "max_stars_repo_name": "openmason/bigote", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/comment.js", "max_issues_repo_name": "openmason/bigote", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/comment.js", "max_forks_repo_name": "openmason/bigote", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 32.6341463415, "max_line_length": 90, "alphanum_fraction": 0.6150971599}
var bigote=require('..');
var assert=require('assert');

// verify comments within mushtache
// {{! comment }}
describe('comments', function() {
  before(function(done) {
    done();
  });
  describe('variable name', function() {
    it('should return with no substitution', function(done) {
      var tmplSource="{{!name}}";
      var context = { name: "charlie" };
      var expectedResult = "";
      var output=bigote.render(bigote.load(tmplSource), context);
      assert.equal(output, expectedResult);
      done();
    });
  });
  describe('with spaces', function() {
    it('should return comments removed', function(done) {
      var tmplSource="This {{!name}}is my template {{name}} {{! nothing should appear }}";
      var context = { name: "fun1" };
      var expectedResult = "This is my template fun1 ";
      var output=bigote.render(bigote.load(tmplSource), context);
      assert.equal(output, expectedResult);
      done();
    });
  });
  describe('multi line', function() {
    it('should ignore till end of markup', function(done) {
      var tmplSource="{{! this is a \n multiline comment \r\n ignore these}}wow!";
      var context = {};
      var expectedResult = "wow!";
      var output=bigote.render(bigote.load(tmplSource), context);
      assert.equal(output, expectedResult);
      done();
    });
  });
});
