<commit_before>describe('AlgoliaSearch Client - Lite', () => {
  it('navigates to algoliasearch-lite.com', async () => {
    await browser.url('algoliasearch-lite.com');
  });

  it('performs SearchIndex::search', async () => {
    const credentials = await browser.credentials();

    const dataset = await browser.dataset();

    const results = await browser.executeAsync(async (credentials, done) => {
      // @ts-ignore
      const index = algoliasearch(credentials.appId, credentials.apiKey).initIndex(
        'javascript-browser-testing-lite',
      );

      done({
        all: await index.search(''),
        first: await index.search('red'),
        last: await index.search('black'),
      });
    }, credentials);

    expect(results.all.nbHits).toBe(dataset.length);

    expect(results.first.hits.pop().value).toEqual('#f00');
    expect(results.first.nbHits).toBe(1);

    expect(results.last.hits.pop().value).toEqual('#000');
    expect(results.last.nbHits).toBe(1);
  });

  it('performs SearchIndex::searchForFacetValues', async () => {
    // @ts-ignore
    const credentials = await browser.credentials();
    // @ts-ignore
    const results = await browser.executeAsync(async (credentials, done) => {
      // @ts-ignore
      const index = algoliasearch(credentials.appId, credentials.apiKey).initIndex(
        'javascript-browser-testing-lite',
      );

      done({
        red: await index.searchForFacetValues('color', 'red'),
        green: await index.searchForFacetValues('color', 'green'),
      });
    }, credentials);

    expect(results.red.facetHits.pop().value).toEqual('red');
    expect(results.green.facetHits.pop().value).toEqual('green');
  });
});
<commit_msg>chore: makes spec compatibly with IE11<commit_after>describe('AlgoliaSearch Client - Lite', () => {
  it('navigates to algoliasearch-lite.com', async () => {
    await browser.url('algoliasearch-lite.com');
  });

  it('performs SearchIndex::search', async () => {
    const credentials = await browser.credentials();

    const dataset = await browser.dataset();

    const results = await browser.executeAsync(function(credentials, done) {
      // @ts-ignore
      const index = algoliasearch(credentials.appId, credentials.apiKey).initIndex(
        'javascript-browser-testing-lite'
      );

      Promise.all([index.search(''), index.search('red'), index.search('black')]).then(function(
        responses
      ) {
        done({
          all: responses[0],
          first: responses[1],
          last: responses[2]
        });
      });
    }, credentials);

    expect(results.all.nbHits).toBe(dataset.length);

    expect(results.first.hits.pop().value).toEqual('#f00');
    expect(results.first.nbHits).toBe(1);

    expect(results.last.hits.pop().value).toEqual('#000');
    expect(results.last.nbHits).toBe(1);
  });

  it('performs SearchIndex::searchForFacetValues', async () => {
    const credentials = await browser.credentials();

    const results = await browser.executeAsync(function(credentials, done) {
      // @ts-ignore
      const index = algoliasearch(credentials.appId, credentials.apiKey).initIndex(
        'javascript-browser-testing-lite'
      );

      Promise.all([
        index.searchForFacetValues('color', 'red'),
        index.searchForFacetValues('color', 'green')
      ]).then(function(responses) {
        done({
          red: responses[0],
          green: responses[1]
        });
      });
    }, credentials);

    expect(results.red.facetHits.pop().value).toEqual('red');
    expect(results.green.facetHits.pop().value).toEqual('green');
  });
});

{'fraction_non_alphanumeric': 0.16666666666666666, 'fraction_numerical': 0.005813953488372093, 'mean_word_length': 3.176878612716763, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '4870348', 'n_tokens_mistral': 1101, 'n_tokens_neox': 1072, 'n_words': 166}