<commit_before>var test = require('tape'),
    Fraudster = require('fraudster'),
    fraudster = new Fraudster(),
    pathToObjectUnderTest = '../index.js',
    errors = require('../lib/errors');


fraudster.registerAllowables([pathToObjectUnderTest, 'util']);


function resetMocks() {
    fraudster.registerMock('request', {});
    fraudster.registerMock('./lib/errors', errors);
}


function getCleanTestObject() {
    delete require.cache[require.resolve(pathToObjectUnderTest)];
    fraudster.enable({useCleanCache: true, warnOnReplace: false});
    var objectUnderTest = require(pathToObjectUnderTest);
    fraudster.disable();
    resetMocks();
    return objectUnderTest;
}

resetMocks();

test('Pushwoosh client exists', function(t){
    t.plan(2);
    var client = getCleanTestObject();
    t.ok(client, 'Pushwoosh client does exist');
    t.equal(typeof client, 'function', 'Pushwoosh is a function as expected');
});

test('Pushwoosh constructor test error case 1: no appCode and authToken', function(t){
    t.plan(2);

    var PwClient = getCleanTestObject();

    try {
        var client = new PwClient();
    } catch (e) {
        t.ok(e, 'Exception exists');
        t.deepEqual(e, new Error('Application ID and Authentication Token from Pushwoosh must be provided'), 'Error does match');
    }
});<commit_msg>Added more tests<commit_after>var test = require('tape'),
    Fraudster = require('fraudster'),
    fraudster = new Fraudster(),
    pathToObjectUnderTest = '../index.js',
    errors = require('../lib/errors'),
    testAppCode = 'testAppCode',
    testAuthToken = '<PASSWORD>',
    testHost = 'http://localhost',
    testApiVersion = '123';

fraudster.registerAllowables([pathToObjectUnderTest, 'util']);

function resetMocks() {
    fraudster.registerMock('request', {});
    fraudster.registerMock('./lib/errors', errors);
}


function getCleanTestObject() {
    delete require.cache[require.resolve(pathToObjectUnderTest)];
    fraudster.enable({useCleanCache: true, warnOnReplace: false});
    var objectUnderTest = require(pathToObjectUnderTest);
    fraudster.disable();
    resetMocks();
    return objectUnderTest;
}

resetMocks();

test('Pushwoosh client exists', function(t){
    t.plan(2);
    var client = getCleanTestObject();
    t.ok(client, 'Pushwoosh client does exist');
    t.equal(typeof client, 'function', 'Pushwoosh is a function as expected');
});

test('Pushwoosh constructor success case', function(t){
    t.plan(4);

    var PwClient = getCleanTestObject(),
        client = new PwClient(testAppCode, testAuthToken, {host: testHost, apiVersion: testApiVersion});

    t.equal(client.appCode, testAppCode, 'Application code passed correctly');
    t.equal(client.authToken, testAuthToken, 'Auth token passed correctly');
    t.equal(client.apiVersion, testApiVersion, 'API version correct');
    t.equal(client.host, testHost, 'API host correct');

});

test('Pushwoosh constructor success case with options', function(t){
    t.plan(4);

    var PwClient = getCleanTestObject(),
        client = new PwClient(testAppCode, testAuthToken);

    t.equal(client.appCode, testAppCode, 'Application code passed correctly');
    t.equal(client.authToken, testAuthToken, 'Auth token passed correctly');
    t.ok(client.apiVersion, 'API version exists');
    t.ok(client.host, 'API host exists');

});


test('Pushwoosh constructor test error case 1: no appCode and authToken', function(t){
    t.plan(2);

    var PwClient = getCleanTestObject();

    try {
        var client = new PwClient();
    } catch (e) {
        t.ok(e, 'Exception exists');
        t.deepEqual(e, new Error('Application ID and Authentication Token from Pushwoosh must be provided'), 'Error does match');
    }
});
{'fraction_non_alphanumeric': 0.13834626705913836, 'fraction_numerical': 0.0029435375970029436, 'mean_word_length': 4.191666666666666, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '3461307', 'n_tokens_mistral': 1128, 'n_tokens_neox': 1113, 'n_words': 278}