<commit_before>require('./helper');

describe('Mustache.render', function () {
  beforeEach(function () {
    Mustache.clearCache();
  });

  it('requires template to be a string', function () {
    assert.throws(function () {
      Mustache.render(['dummy template'], ['foo', 'bar']);
    }, TypeError, 'Invalid template! Template should be a "string" but "array" was given');
  });

  var i;
  var tests = {{{.}}};

  for (i = 0; i < tests.length; i++) {

    (function indexClosure(test) {
        var view = eval(test.view);

        it('knows how to render ' + test.name, function () {

          var output;
          if (test.partial) {
            output = Mustache.render(test.template, view, { partial: test.partial });
          } else {
            output = Mustache.render(test.template, view);
          }

          assert.equal(output, test.expect);<commit_msg>Equal error message test in .render() for server and browser.<commit_after>require('./helper');

describe('Mustache.render', function () {
  beforeEach(function () {
    Mustache.clearCache();
  });

  it('requires template to be a string', function () {
    assert.throws(function () {
      Mustache.render(['dummy template'], ['foo', 'bar']);
    }, TypeError, 'Invalid template! Template should be a "string" but ' +
                  '"array" was given as the first argument ' +
                  'for mustache#render(template, view, partials)');
  });

  var i;
  var tests = {{{.}}};

  for (i = 0; i < tests.length; i++) {

    (function indexClosure(test) {
        var view = eval(test.view);

        it('knows how to render ' + test.name, function () {

          var output;
          if (test.partial) {
            output = Mustache.render(test.template, view, { partial: test.partial });
          } else {
            output = Mustache.render(test.template, view);
          }

          assert.equal(output, test.expect);
{'fraction_non_alphanumeric': 0.15709812108559498, 'fraction_numerical': 0.0010438413361169101, 'mean_word_length': 2.472826086956522, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1443615', 'n_tokens_mistral': 566, 'n_tokens_neox': 541, 'n_words': 146}