<commit_before>/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function(el) {

  test("the third param is to create nested elements", function() {
    var e = el('p', {}, [el('a')]);
    ok( e.nodeName.match(/p/i) );
    equal( e.childNodes.length, 1, 'the parent element has a child');
    var child = e.childNodes[0];
    ok( child.nodeName.match(/a/i) );
    equal( child.parentNode, e );
  });

  test("if the second param is an array, it's assumed that no attributes were specified", function() {
    var e = el('p', [el('a')]);
    equal( e.childNodes.length, 1, 'the parent element has a child');
    ok( e.childNodes[0].nodeName.match(/a/i) );
  });

  test("a string in the children creates a text node", function() {
    var e = el('p', ["my awesome paragraph"]);
    equal( e.childNodes.length, 1, 'the parent element has a child');
    equal( e.childNodes[0].textContent, 'my awesome paragraph' );
  });

  test("a string can replace the children array, as a shortcut", function() {
    var e = el('p', "my awesome paragraph");
    equal( e.childNodes.length, 1, 'the parent element has a child');
    equal( e.childNodes[0].textContent, 'my awesome paragraph' );
  });

}(el));<commit_msg>Fix the check for child node's text. textContent is not in IE8 and older.<commit_after>/*global QUnit:false, module:false, test:false, asyncTest:false, expect:false*/
/*global start:false, stop:false ok:false, equal:false, notEqual:false, deepEqual:false*/
/*global notDeepEqual:false, strictEqual:false, notStrictEqual:false, raises:false*/
(function(el) {

  test("the third param is to create nested elements", function() {
    var e = el('p', {}, [el('a')]);
    ok( e.nodeName.match(/p/i) );
    equal( e.childNodes.length, 1, 'the parent element has a child');
    var child = e.childNodes[0];
    ok( child.nodeName.match(/a/i) );
    equal( child.parentNode, e );
  });

  test("if the second param is an array, it's assumed that no attributes were specified", function() {
    var e = el('p', [el('a')]);
    equal( e.childNodes.length, 1, 'the parent element has a child');
    ok( e.childNodes[0].nodeName.match(/a/i) );
  });

  test("a string in the children creates a text node", function() {
    var e = el('p', ["my awesome paragraph"]);
    equal( e.childNodes.length, 1, 'the parent element has a child');
    equal( e.innerText, 'my awesome paragraph' );
  });

  test("a string can replace the children array, as a shortcut", function() {
    var e = el('p', "my awesome paragraph");
    equal( e.childNodes.length, 1, 'the parent element has a child');
    equal( e.innerText, 'my awesome paragraph' );
  });

}(el));
{'fraction_non_alphanumeric': 0.1660814606741573, 'fraction_numerical': 0.0052668539325842695, 'mean_word_length': 4.015845070422535, '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': '4081938', 'n_tokens_mistral': 917, 'n_tokens_neox': 897, 'n_words': 298}