<commit_before>// Make sure jsHint allows the use of Mocha-globals
/* global describe, it */

// Make sure jsHint allows the use of Mocha-globals
/* global describe, it, before, after, beforeEach, afterEach */

var assert = require('chai').assert;
var nock = require('nock'); // nock allows for mocking http(s) requests
var sinon = require('sinon'); // SinonJS creates stubs/mocks/spies on js objects


// Import the module to test
var issues = require('../../modules/issues/issues.js');

// Import the module to test
var example = require("../../modules/example/example");

describe('Module Example', function () {

    before(function(){
        // We need to provide an irc client, an empty one will do
        global.irc = {
            'client': {
                'say': function(){}
            }
        };
    });

    after(function(){
        delete global.irc;
    });

    var stubIrcSay;
    beforeEach(function(){
        // Stub the client.say method for each test
        stubIrcSay = sinon.stub(global.irc.client, 'say');
    });

    afterEach(function(){
        stubIrcSay.restore();
        nock.cleanAll();
    });

    describe('#handle()', function () {
        it('should send "Hello channel" to the channel', function () {

            // Fake a message to the channel testChan
            example.handle('testFrom', 'testChan', 'testMsg');

            assert.isTrue(stubIrcSay.calledOnce);
            assert.deepEqual(stubIrcSay.args[0], ['testChan', 'Hello channel']);
        });
    });

    describe('#handlePM()', function () {
        it('should send "Hello <user>" to the user', function () {

            // Fake a PM from 'testUser'
            example.handlePM('testUser', 'testMsg');

            assert.isTrue(stubIrcSay.calledOnce);
            assert.deepEqual(stubIrcSay.args[0], ['testUser', 'Hello testUser']);
        });
    });
});
<commit_msg>Removed issues import from example test<commit_after>// Make sure jsHint allows the use of Mocha-globals
/* global describe, it */

// Make sure jsHint allows the use of Mocha-globals
/* global describe, it, before, after, beforeEach, afterEach */

var assert = require('chai').assert;
var nock = require('nock'); // nock allows for mocking http(s) requests
var sinon = require('sinon'); // SinonJS creates stubs/mocks/spies on js objects

// Import the module to test
var example = require("../../modules/example/example");

describe('Module Example', function () {

    before(function(){
        // We need to provide an irc client, an empty one will do
        global.irc = {
            'client': {
                'say': function(){}
            }
        };
    });

    after(function(){
        delete global.irc;
    });

    var stubIrcSay;
    beforeEach(function(){
        // Stub the client.say method for each test
        stubIrcSay = sinon.stub(global.irc.client, 'say');
    });

    afterEach(function(){
        stubIrcSay.restore();
        nock.cleanAll();
    });

    describe('#handle()', function () {
        it('should send "Hello channel" to the channel', function () {

            // Fake a message to the channel testChan
            example.handle('testFrom', 'testChan', 'testMsg');

            assert.isTrue(stubIrcSay.calledOnce);
            assert.deepEqual(stubIrcSay.args[0], ['testChan', 'Hello channel']);
        });
    });

    describe('#handlePM()', function () {
        it('should send "Hello <user>" to the user', function () {

            // Fake a PM from 'testUser'
            example.handlePM('testUser', 'testMsg');

            assert.isTrue(stubIrcSay.calledOnce);
            assert.deepEqual(stubIrcSay.args[0], ['testUser', 'Hello testUser']);
        });
    });
});

{'fraction_non_alphanumeric': 0.14791946308724832, 'fraction_numerical': 0.0010738255033557046, 'mean_word_length': 2.396536007292616, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '2460354', 'n_tokens_mistral': 1097, 'n_tokens_neox': 1053, 'n_words': 297}