<commit_before>'use strict';

import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';
import sinon from 'sinon';
import sinonChai from 'sinon-chai';

import pixabay from '../src/index';
import ResultList from '../src/result-list';


const {expect} = chai;

chai.use(chaiAsPromised);
chai.use(sinonChai);

const key = 'key';

describe('Pixabayjs', function() {
  this.timeout(30000);
  let client;

  beforeEach(function() {
    client = Object.create(pixabay);
  });

  afterEach(function() {
    client = null;
  });

  describe('authenticate', function() {
    it('sets the client\'s key', function() {
      client.authenticate(key);
      expect(client._auth.key).to.equal(key);
    });
  });

  describe('imageResultList', function() {
    const search = ['dogs', 'puppies'];

    it('returns a ResultList', function() {
      expect(client.imageResultList(search)).to.be.instanceof(ResultList);
    });

    it('uses the image url', function() {
      const spy = sinon.spy(client, '_makeConfig');
      client.imageResultList(search);
      expect(spy).to.be.calledWith('https://pixabay.com/api');
    });
  });

  describe('videoResultList', function() {
    const search = ['dogs', 'puppies'];

    it('returns a ResultList', function() {
      expect(client.videoResultList(search)).to.be.instanceof(ResultList);
    });

    it('uses the video url', function() {
      const spy = sinon.spy(client, '_makeConfig');
      client.videoResultList(search);
      expect(spy).to.be.calledWith('https://pixabay.com/api/videos');
    });
  });
});
<commit_msg>Update tests to check the return object<commit_after>'use strict';

import chai from 'chai';
import chaiAsPromised from 'chai-as-promised';

import pixabay from '../src/index';
import ResultList from '../src/result-list';


const {expect} = chai;

chai.use(chaiAsPromised);

const key = 'key';

describe('Pixabayjs', function() {
  this.timeout(30000);
  let client;

  beforeEach(function() {
    client = Object.create(pixabay);
  });

  afterEach(function() {
    client = null;
  });

  describe('authenticate', function() {
    it('sets the client\'s key', function() {
      client.authenticate(key);
      expect(client._auth.key).to.equal(key);
    });
  });

  describe('imageResultList', function() {
    const search = ['dogs', 'puppies'];

    it('returns a ResultList', function() {
      expect(client.imageResultList(search)).to.be.instanceof(ResultList);
    });

    it('uses the image url', function() {
      const resultList = client.imageResultList(search);
      expect(resultList._options.url).to.eq('https://pixabay.com/api/');
    });
  });

  describe('videoResultList', function() {
    const search = ['dogs', 'puppies'];

    it('returns a ResultList', function() {
      expect(client.videoResultList(search)).to.be.instanceof(ResultList);
    });

    it('uses the video url', function() {
      const resultList = client.videoResultList(search);
      expect(resultList._options.url).to.eq('https://pixabay.com/api/videos/');
    });
  });
});

{'fraction_non_alphanumeric': 0.17506544502617802, 'fraction_numerical': 0.0032722513089005235, 'mean_word_length': 3.7175925925925926, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 4, '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': '3997431', 'n_tokens_mistral': 1021, 'n_tokens_neox': 982, 'n_words': 189}