"use strict";

var _filter = require("../filter");

describe("hasStringMatch", function () {
  var strings = ["banana", "ana", "grAna", "popeye", "fantano", "gAnA"];
  var pattern = "ana";
  test("Simple matching without lowercase", function () {
    var matches = strings.reduce(function (acc, currString) {
      if ((0, _filter.hasStringMatch)(pattern, currString)) {
        return acc + 1;
      }

      return acc;
    }, 0);
    expect(matches).toBe(2);
  });
  test("Simple matching with lowercase", function () {
    var matches = strings.reduce(function (acc, currString) {
      if ((0, _filter.hasStringMatch)(pattern, currString.toLowerCase())) {
        return acc + 1;
      }

      return acc;
    }, 0);
    expect(matches).toBe(4);
  });
});