<commit_before>var path = require('path'),
	fs = require('fs'),
	os = require('os'),
	assert = require('assert'),
	swintAkamaiPurge = require('../lib');

global.swintVar.printLevel = 5;

describe('secret', function() {
	this.timeout(10000);
	
	it('Error when no callback', function() {
		assert.throws(function() {
			swintAkamaiPurge({});
		});
	});

	it('Error when dir doesn\'t exist', function(done) {
		swintAkamaiPurge({
			dir: '/this-directory-does-not-exist'
		}, function(err, res) {
			assert.notEqual(err, null);
			done();
		});
	});

	it('Simple case', function(done) {
		var credPath = path.join(process.env.HOME, '.swint', 'swint-akamai-purge.json'),
			cred = JSON.parse(fs.readFileSync(credPath));

		swintAkamaiPurge({
			dir: path.join(__dirname, '../test_case'),
			urlPrefix: cred.prefix,
			akInfo: {
				user: cred.user,
				password: <PASSWORD><commit_msg>Added env variable on test environment<commit_after>var path = require('path'),
	fs = require('fs'),
	os = require('os'),
	assert = require('assert'),
	swintAkamaiPurge = require('../lib');

global.swintVar.printLevel = 5;

describe('secret', function() {
	this.timeout(10000);
	
	it('Error when no callback', function() {
		assert.throws(function() {
			swintAkamaiPurge({});
		});
	});

	it('Error when dir doesn\'t exist', function(done) {
		swintAkamaiPurge({
			dir: '/this-directory-does-not-exist'
		}, function(err, res) {
			assert.notEqual(err, null);
			done();
		});
	});

	it('Simple case', function(done) {
		var credPath = path.join(process.env.HOME, '.swint', 'swint-akamai-purge-test.json'),
			cred;

		try {
			fs.accessSync(credPath);
			cred = JSON.parse(fs.readFileSync(credPath));
		} catch(e) {
			cred = {
				user: process.env.SWINT_AKAMAI_PURGE_TEST_USER,
				password: <PASSWORD>,
				prefix: process.env.SWINT_AKAMAI_PURGE_TEST_PREFIX
			};
		}

		swintAkamaiPurge({
			dir: path.join(__dirname, '../test_case'),
			urlPrefix: cred.prefix,
			akInfo: {
				user: cred.user,
				password: <PASSWORD>
{'fraction_non_alphanumeric': 0.18177290836653387, 'fraction_numerical': 0.00597609561752988, 'mean_word_length': 4.035087719298246, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, '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': '3164103', 'n_tokens_mistral': 842, 'n_tokens_neox': 722, 'n_words': 131}