<commit_before>'use strict'
describe('Repository', function() {
  var repository

  beforeEach(function() {
    repository = require('./Repository.js')
    repository.put(data)
  })

  afterEach(function () {
    repository.clear()
  })



  var barElement = {title:'bar', content: 'bar'}
  var almostBarElement = {title:'almostbar', content: 'almostbar'}
  var loremElement = {title:'lorem', content: 'lorem ipsum'}

  var data = [barElement,almostBarElement,loremElement]

  it('finds a simple string', function() {
    expect(
      repository.search('bar')
    ).toEqual(
      [barElement,almostBarElement]
    )
  })

  it('limits the search results to one even if found more', function() {
    repository.setOptions({limit:1})
    expect(
      repository.search('bar')
    ).toEqual(
      [barElement]
    )
  })

  it('finds a long string', function() {
    expect(
      repository.search('lorem ipsum')
    ).toEqual(
      [loremElement]
    )
  })

  it('finds a fuzzy string', function() {
    repository.setOptions({fuzzy:true})
    expect(
      repository.search('lrm ism')
    ).toEqual(
      [loremElement]
    )
  })

  it('nots search when an empty criteria is provided', function() {
    expect(
      repository.search('')
    ).toEqual(
      []
    )
  })

  it('excludes items', function () {
    repository.setOptions({
      exclude: ['almostbar']
    })
    expect(
      repository.search('almostbar')
    ).toEqual(
      []
    )
  })
})<commit_msg>cleanup<commit_after>'use strict'

var barElement = {title:'bar', content: 'bar'}
var almostBarElement = {title:'almostbar', content: 'almostbar'}
var loremElement = {title:'lorem', content: 'lorem ipsum'}

var data = [barElement,almostBarElement,loremElement]

describe('Repository', function() {
  var repository

  beforeEach(function() {
    repository = require('./Repository.js')
    repository.put(data)
  })

  afterEach(function () {
    repository.clear()
  })

  it('finds a simple string', function() {
    expect(
      repository.search('bar')
    ).toEqual(
      [barElement,almostBarElement]
    )
  })

  it('limits the search results to one even if found more', function() {
    repository.setOptions({limit:1})
    expect(
      repository.search('bar')
    ).toEqual(
      [barElement]
    )
  })

  it('finds a long string', function() {
    expect(
      repository.search('lorem ipsum')
    ).toEqual(
      [loremElement]
    )
  })

  it('finds a fuzzy string', function() {
    repository.setOptions({fuzzy:true})
    expect(
      repository.search('lrm ism')
    ).toEqual(
      [loremElement]
    )
  })

  it('returns empty search results when an empty criteria is provided', function() {
    expect(
      repository.search('')
    ).toEqual(
      []
    )
  })

  it('excludes items from search', function () {
    repository.setOptions({
      exclude: ['almostbar']
    })
    expect(
      repository.search('almostbar')
    ).toEqual(
      []
    )
  })
})
{'fraction_non_alphanumeric': 0.15033557046979865, 'fraction_numerical': 0.0006711409395973154, 'mean_word_length': 2.9120734908136483, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 4, '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': '6502446', 'n_tokens_mistral': 945, 'n_tokens_neox': 914, 'n_words': 200}