<commit_before>import chai from 'chai';
import nconf from 'nconf';
import nock from 'nock';
import path from 'path';

import lol from '../lib/leagueoflegends';
import { loadFixtures } from './_helpers';

chai.should();
const FIXTURES = loadFixtures(path.join(__dirname, './fixtures/leagueoflegends/'));

describe('league of legends', () => {
  before(() => {
    nconf.set('CHAMPIONGG_API', 'api_key');
    nconf.set('RIOT_KEY', 'api_key');
  });

  beforeEach(() => {
    nock.cleanAll();
  });

  describe('counters', () => {
    it('should return counters for ekko mid', done => {
      function sendMessage(channel, res) {
        channel.should.equal('test');
        res.should.equal(`Sure! Here's the top 10 **statistical** counters for **Ekko Middle**:

*1st*. **KogMaw** - 58.63% win rate over 29 games.
*2nd*. **Jayce** - 52.81% win rate over 89 games.
*3rd*. **Karthus** - 58.09% win rate over 136 games.
*4th*. **Cassiopeia** - 52.83% win rate over 195 games.
*5th*. **Ziggs** - 52.89% win rate over 225 games.
*6th*. **Mordekaiser** - 62.5% win rate over 16 games.
*7th*. **Urgot** - 53.85% win rate over 13 games.
*8th*. **Akali** - 48.68% win rate over 189 games.
*9th*. **Heimerdinger** - 50.8% win rate over 126 games.
*10th*. **Veigar** - 45.53% win rate over 257 games.`);
        done();
      }

      nock('http://api.champion.gg')
        .get('/champion/ekko/matchup?api_key=api_key')
        .reply(200, FIXTURES.counters);

      lol.lol({sendMessage}, {channel: 'test'}, 'counters ekko mid');
    });
  });

  describe('items', () => {
    it('should return an image buffer larger then 80000', function(done) {
      this.timeout(7000);
      function sendFile(channel, res) {
        channel.should.equal('test');
        res.length.should.be.at.least(80000);
        done();
      }

      nock('http://api.champion.gg')
        .get('/champion/ekko/items/finished/mostWins?api_key=api_key')<commit_msg>update tests<commit_after>import chai from 'chai';
import nconf from 'nconf';
import nock from 'nock';
import path from 'path';

import lol from '../lib/leagueoflegends';
import { loadFixtures } from './_helpers';

chai.should();
const FIXTURES = loadFixtures(path.join(__dirname, './fixtures/leagueoflegends/'));

describe('league of legends', () => {
  before(() => {
    nconf.set('CHAMPIONGG_API', 'api_key');
    nconf.set('RIOT_KEY', 'api_key');
  });

  beforeEach(() => {
    nock.cleanAll();
  });

  describe('counters', () => {
    it('should return counters for ekko mid', done => {
      function sendMessage(channel, res) {
        channel.should.equal('test');
        res.should.equal(`Sure! Here's the top 10 **statistical** counters for **Ekko Middle**:

*1st*. **KogMaw** - 58.63% win rate over 29 games.
*2nd*. **Jayce** - 52.81% win rate over 89 games.
*3rd*. **Karthus** - 58.09% win rate over 136 games.
*4th*. **Cassiopeia** - 52.83% win rate over 195 games.
*5th*. **Ziggs** - 52.89% win rate over 225 games.
*6th*. **Mordekaiser** - 62.5% win rate over 16 games.
*7th*. **Urgot** - 53.85% win rate over 13 games.
*8th*. **Akali** - 48.68% win rate over 189 games.
*9th*. **Heimerdinger** - 50.8% win rate over 126 games.
*10th*. **Veigar** - 45.53% win rate over 257 games.`);
        done();
      }

      nock('http://api.champion.gg')
        .get('/champion/ekko/matchup?api_key=api_key')
        .reply(200, FIXTURES.counters);

      lol.lol({sendMessage}, {channel: 'test'}, 'counters ekko mid');
    });
  });

  describe('items', () => {
    it('should return an image buffer larger then 70000', function(done) {
      this.timeout(7000);
      function sendFile(channel, res) {
        channel.should.equal('test');
        res.length.should.be.at.least(70000);
        done();
      }

      nock('http://api.champion.gg')
        .get('/champion/ekko/items/finished/mostWins?api_key=api_key')
{'fraction_non_alphanumeric': 0.18897230132021745, 'fraction_numerical': 0.0486668392441108, 'mean_word_length': 3.163793103448276, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5154119', 'n_tokens_mistral': 1522, 'n_tokens_neox': 1353, 'n_words': 342}