<commit_before><commit_msg>WIP Filtering<commit_after>import assert from 'assert'
import { messages } from '@cucumber/messages'
import Search from '../../src/search/Search'
import { makeFeature, makeScenario, makeStep } from './utils'

describe('Search', () => {
  let search: Search
  let gherkinDocuments: messages.IGherkinDocument[]

  beforeEach(() => {
    gherkinDocuments = [
      messages.GherkinDocument.create({
        uri: 'some/feature.file',
        feature: makeFeature('Continents', 'The world is divided in continents', [
          makeScenario('Europe', 'The old continent', [
            makeStep('Given', 'France'),
            makeStep('When', 'Spain'),
            makeStep('Then', 'The Netherlands'),
          ]),
          makeScenario('America', 'The new continent', [
            makeStep('When', 'Mexico'),
            makeStep('Then', 'Brazil'),
          ]),
        ]),
      }),
    ]

    search = new Search()
    for (const gherkinDocument of gherkinDocuments) {
      search.add(gherkinDocument)
    }
  })

  context('Hit found in step', () => {
    it('displays just one scenario', () => {
      const searchResults = search.search('Spain')

      assert.deepStrictEqual(searchResults, [])
    })
  })
})


{'fraction_non_alphanumeric': 0.15261044176706828, 'fraction_numerical': 0.0, 'mean_word_length': 2.7417417417417416, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '5002965', 'n_tokens_mistral': 368, 'n_tokens_neox': 346, 'n_words': 79}