<commit_before>// Testing tools
function restoreState(el, body) {
  el.innerHTML = body;
}


// Contains tests for the Burly singleton. 
// This is the api that end users will consume.
QUnit.module("Burly", function( hooks ) {

  // setUp before each test
  hooks.beforeEach(function() {
    this.el = document.getElementById("test-element"); 
    this.data = { testBind: "Successful Bind" };
  });

  // tearDown after each test
  hooks.afterEach(function() {
    restoreState(this.el, "{{ testBind }}");
  });

  QUnit.test("render()", function( assert ) {
    assert.equal(
      "function",
      typeof Burly.render,
      "Burly contains a render function"
    );

    assert.equal(
      this.el.innerHTML, 
      "{{ testBind }}", 
      "View contains a {{ key }} to bind model data to" 
    );

    Burly.render( "view", this.data );

    assert.equal( this.el.innerHTML, 
      "Successful Bind", 
      "Model data bound to a views {{ key }}" 
    );

    assert.throws( 
      function() {
        Burly.render( "badView", this.data )
      }, 
      "undefined scope: badView",
      "Throws a 'undefined scope:' error" 
    ); 
  });

});


// Contains test for the Bind constructor
QUnit.module("Bind", function( hooks ) {

  // setUp before each test
  hooks.beforeEach(function() {
    this.el = document.getElementById("test-element"); 
    this.data = { testBind: "Successful Bind" };
    this.bind = new Bind( "view", this.data );
  });

  // tearDown after each test
  hooks.afterEach(function() {
    restoreState(this.el, "{{ testBind }}");
  });

  QUnit.test("run()", function( assert ) {
    assert.equal( 
      "function", 
      typeof this.bind.run,
      "Bind contains a run function"
    );
  });

});
<commit_msg>Have a template for testing set and wrote tests for Bind.run()<commit_after>// Testing tools
function restoreState(el, body) {
  el.innerHTML = body;
}

// Contains tests for utility functions
QUnit.module("Util", function( hooks ) {
  QUnit.test("curlyRe()", function( assert ) {
    assert.equal(
      "function",
      typeof Util.curlyRe,
      "curlyRe is a function"
    );

    assert.ok(
        Util.curlyRe("{{ test }}") instanceof Array,
        "Returns an array when regex matches"
    );

    assert.ok(
        Util.curlyRe("{ test }}") === null,
        "Returns null when regex does not match"
    );
  });
});


// Contains tests for the Burly singleton.
// This is the api that end users will consume.
QUnit.module("Burly", function( hooks ) {
  // setUp before each test
  hooks.beforeEach(function() {
    this.el = document.getElementById("test-element");
    this.data = { testBind: "Successful Bind" };
  });

  // tearDown after each test
  hooks.afterEach(function() {
    restoreState(this.el, "{{ testBind }}");
  });

  QUnit.test("render()", function( assert ) {
    assert.equal(
      "function",
      typeof Burly.render,
      "Burly contains a render function"
    );

    assert.equal(
      this.el.innerHTML,
      "{{ testBind }}",
      "View contains a {{ key }} to bind model data to"
    );

    Burly.render( "view", this.data );

    assert.equal(
      this.el.innerHTML,
      "Successful Bind",
      "Model data bound to a views {{ key }}"
    );

    assert.throws(
      function() {
        Burly.render( "badView", this.data )
      },
      "undefined view: badView",
      "Throws a 'undefined view' error"
    );
  });
});


// Contains test for the Bind constructor
QUnit.module("Bind", function( hooks ) {
  // setUp before each test
  hooks.beforeEach(function() {
    this.el = document.getElementById("test-element");
    this.data = { testBind: "Successful Bind" };
    this.bind = new Bind( "view", this.data );
  });

  // tearDown after each test
  hooks.afterEach(function() {
    restoreState(this.el, "{{ testBind }}");
  });

  QUnit.test("run()", function( assert ) {
    assert.equal(
      "function",
      typeof this.bind.run,
      "Bind contains a run function"
    );

    assert.equal(
      this.el.innerHTML,
      "Successful Bind",
      "Model data bound to a views {{ key }}"
    );

    assert.equal(
      this.el,
      this.bind.root,
      "Bind sets root to the view name"
    );

    assert.throws(
      function() {
        new Bind( "badView", this.data )
      },
      "undefined view: badView",
      "Throws a 'undefined view' error"
    );
  });

  QUnit.test("traverse_DOM()", function( assert ) {
    assert.ok(
      true,
      "placeholder"
    );
  });

  QUnit.test("node_builder()", function( assert ) {
    assert.ok(
      true,
      "placeholder"
    );
  });

  QUnit.test("bind_data()", function( assert ) {
    assert.ok(
      true,
      "placeholder"
    );
  });
});


// Contains test for the Bind_factory
QUnit.module("Bind_factory", function( hooks ) {
  // setUp before each test
  hooks.beforeEach(function() {
    this.el = document.getElementById("test-element");
    this.data = { testBind: "Successful Bind" };
  });

  // tearDown after each test
  hooks.afterEach(function() {
    restoreState(this.el, "{{ testBind }}");
  });

  QUnit.test("build()", function( assert ) {
    assert.ok(
      true,
      "placeholder"
    );
  });
});
{'fraction_non_alphanumeric': 0.15257811002491853, 'fraction_numerical': 0.0, 'mean_word_length': 2.48563794255177, 'pattern_counts': {'":': 0, '<': 3, '<?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': '2915279', 'n_tokens_mistral': 1680, 'n_tokens_neox': 1634, 'n_words': 414}