<commit_before>var assert = require('assert');
var sinon = require('sinon');
var GitterBot = require('../lib/GitterBot');
var DEFAULT_CONFIG = {
  apiKey: 'API_KEY',
  roomName: 'ghaiklor/uwcua-vii',
  execPattern: /^calc\s+/
};

describe('GitterBot', function () {
  it('Should properly exports', function () {
    assert.equal(typeof GitterBot, 'function');
  });

  it('Should properly create instance of GitterBot', function () {
    assert(new GitterBot(DEFAULT_CONFIG) instanceof GitterBot);
  });

  it('Should properly get/set API key', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert.equal(bot.getApiKey(), DEFAULT_CONFIG.apiKey);

    bot.setApiKey('new-api-key');
    assert.equal(bot.getApiKey(), 'new-api-key');
  });

  it('Should properly get/set room name', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert.equal(bot.getRoomName(), DEFAULT_CONFIG.roomName);

    bot.setRoomName('new-room');
    assert.equal(bot.getRoomName(), 'new-room');
  });

  it('Should properly get/set exec pattern', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert.equal(bot.getExecPattern(), DEFAULT_CONFIG.execPattern);

    bot.setExecPattern('^my pattern');
    assert.equal(bot.getExecPattern(), '/^my pattern/');

    bot.setExecPattern(/test/);
    assert.equal(bot.getExecPattern(), '/test/');
  });

  it('Should properly start bot', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert(bot.start() instanceof GitterBot);<commit_msg>Add test for API key is not exists<commit_after>var assert = require('assert');
var sinon = require('sinon');
var GitterBot = require('../lib/GitterBot');
var DEFAULT_CONFIG = {
  apiKey: 'API_KEY',
  roomName: 'ghaiklor/uwcua-vii',
  execPattern: /^calc\s+/
};

describe('GitterBot', function () {
  it('Should properly exports', function () {
    assert.equal(typeof GitterBot, 'function');
  });

  it('Should properly create instance of GitterBot', function () {
    assert(new GitterBot(DEFAULT_CONFIG) instanceof GitterBot);
  });

  it('Should properly get/set API key', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert.equal(bot.getApiKey(), DEFAULT_CONFIG.apiKey);

    bot.setApiKey('new-api-key');
    assert.equal(bot.getApiKey(), 'new-api-key');
  });

  it('Should properly throw exception when API key is not exists', function () {
    assert.throws(function () {
      new GitterBot();
    }, Error);
  });

  it('Should properly get/set room name', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert.equal(bot.getRoomName(), DEFAULT_CONFIG.roomName);

    bot.setRoomName('new-room');
    assert.equal(bot.getRoomName(), 'new-room');
  });

  it('Should properly get/set exec pattern', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert.equal(bot.getExecPattern(), DEFAULT_CONFIG.execPattern);

    bot.setExecPattern('^my pattern');
    assert.equal(bot.getExecPattern(), '/^my pattern/');

    bot.setExecPattern(/test/);
    assert.equal(bot.getExecPattern(), '/test/');
  });

  it('Should properly start bot', function () {
    var bot = new GitterBot(DEFAULT_CONFIG);
    assert(bot.start() instanceof GitterBot);
{'fraction_non_alphanumeric': 0.16194331983805668, 'fraction_numerical': 0.0, 'mean_word_length': 4.2058346839546195, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6682082', 'n_tokens_mistral': 1023, 'n_tokens_neox': 997, 'n_words': 219}