<commit_before>QUnit.module("ImageLoader");

QUnit.test("Make sure it works", function (assert) {
  assert.ok(true, "QUnit is there.");
  assert.ok(sinon, "Sinon is there too.");
});
<commit_msg>Add couple ImageLoader tests.<commit_after>QUnit.module("ImageLoader");

// Embedded images to use in tests.
var INVALID_IMAGE = "data:image/gif;base64,invalid=",
    BLACK_GIF = "data:image/gif;base64,R0lGODdhAQABAIABAAAAAP///ywAAAAAAQABAAACAkQBADs=",
    RED_GIF = "data:image/gif;base64,R0lGODdhAQABAIABAP8AAP///ywAAAAAAQABAAACAkQBADs=",
    WHITE_GIF = "data:image/gif;base64,R0lGODdhAQABAIAAAP///////ywAAAAAAQABAAACAkQBADs=",
    VALID_IMAGES = [ BLACK_GIF, RED_GIF, WHITE_GIF];

QUnit.test("Nothing to load (no args)", function (assert) {
  var loader = new ImageLoader();
  assert.ok(loader instanceof ImageLoader, "ImageLoader instance created.");

  var expected = 0;
  var actual = loader.getImages().length;
  assert.equal(actual, expected, "There was nothing to load.");
});

QUnit.test("Load single URL (not an array)", function (assert) {
  var loader = new ImageLoader(BLACK_GIF);
  assert.ok(loader instanceof ImageLoader, "ImageLoader instance created.");

  var expected = 1;
  var actual = loader.getImages().length;
  assert.equal(actual, expected, "Single image loaded.");
});

QUnit.test("Load multiple URLs", function (assert) {
  var loader = new ImageLoader(VALID_IMAGES);
  assert.ok(loader instanceof ImageLoader, "ImageLoader instance created.");

  var expected = 3;
  var actual = loader.getImages().length;
  assert.equal(actual, expected, "Multiple images loaded.");
});

{'fraction_non_alphanumeric': 0.14267834793491865, 'fraction_numerical': 0.009386733416770964, 'mean_word_length': 5.24609375, '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': '5780487', 'n_tokens_mistral': 556, 'n_tokens_neox': 534, 'n_words': 124}