lib/cli.js
function prepareEnvironment (argv) {

	var params, args;

	// Define default values
	params = {
		'approved-folder': 'approved',
		'build-folder': 'build',
		'highlight-folder': 'highlight',
		'config-folder': 'config',
		'fail-orphans': false,
		'fail-additions': false,
		'test-path': null,
		'config': null
	};

	// Filter arguments
	args = filterArguments(argv, params, [
		'--slow', '5000',
		'--no-timeouts'
	]);

	if (!fs.existsSync(params['test-path'])) {
		throw new Error('Cannot find path to ' + params['test-path']);
	} else {
		params['test-path'] = path.resolve(params['test-path']);
	}

	// Load global config
	if (typeof params['config'] === 'string') {
		params['config'] = require(path.resolve(params['config']));
	} else {
		params['config'] = params['config'] || {};
	}

	// Set global variable for test-runner
	global.koboldOptions = {
		"verbose": false,

		"failForOrphans": params['fail-orphans'],
		"failOnAdditions": params['fail-additions'],

		"build": params['build'],

		"comparison": params['config'],

		"storage": {
			"type": 'File',

			"options": {
				"path": params['test-path'],
				"approvedFolderName": params['approved-folder'],
				"buildFolderName": params['build-folder'],
				"highlightFolderName": params['highlight-folder'],
				"configFolderName": params['config-folder']
			}
		}
	};

	return args;
}
function prepareEnvironment (argv) {

	var params, args;

	// Define default values
	params = {
		'approved-folder': 'approved',
		'build-folder': 'build',
		'highlight-folder': 'highlight',
		'config-folder': 'config',
		'fail-orphans': false,
		'fail-additions': false,
		'test-path': null,
		'config': null
	};

	// Filter arguments
	args = filterArguments(argv, params, [
		'--slow', '5000',
		'--no-timeouts'
	]);

	if (!fs.existsSync(params['test-path'])) {
		throw new Error('Cannot find path to ' + params['test-path']);
	} else {
		params['test-path'] = path.resolve(params['test-path']);
	}

	// Load global config
	if (typeof params['config'] === 'string') {
		params['config'] = require(path.resolve(params['config']));
	} else {
		params['config'] = params['config'] || {};
	}

	// Set global variable for test-runner
	global.koboldOptions = {
		"verbose": false,

		"failForOrphans": params['fail-orphans'],
		"failOnAdditions": params['fail-additions'],

		"build": params['build'],

		"comparison": params['config'],

		"storage": {
			"type": 'File',

			"options": {
				"path": params['test-path'],
				"approvedFolderName": params['approved-folder'],
				"buildFolderName": params['build-folder'],
				"highlightFolderName": params['highlight-folder'],
				"configFolderName": params['config-folder']
			}
		}
	};

	return args;
}
function prepareEnvironment ( argv ) { var params , args ; // Define default values params = { 'approved-folder' : 'approved' , 'build-folder' : 'build' , 'highlight-folder' : 'highlight' , 'config-folder' : 'config' , 'fail-orphans' : false , 'fail-additions' : false , 'test-path' : null , 'config' : null } ; // Filter arguments args = filterArguments ( argv , params , [ '--slow' , '5000' , '--no-timeouts' ] ) ; if ( ! fs . existsSync ( params [ 'test-path' ] ) ) { throw new Error ( 'Cannot find path to ' + params [ 'test-path' ] ) ; } else { params [ 'test-path' ] = path . resolve ( params [ 'test-path' ] ) ; } // Load global config if ( typeof params [ 'config' ] === 'string' ) { params [ 'config' ] = require ( path . resolve ( params [ 'config' ] ) ) ; } else { params [ 'config' ] = params [ 'config' ] || { } ; } // Set global variable for test-runner global . koboldOptions = { "verbose" : false , "failForOrphans" : params [ 'fail-orphans' ] , "failOnAdditions" : params [ 'fail-additions' ] , "build" : params [ 'build' ] , "comparison" : params [ 'config' ] , "storage" : { "type" : 'File' , "options" : { "path" : params [ 'test-path' ] , "approvedFolderName" : params [ 'approved-folder' ] , "buildFolderName" : params [ 'build-folder' ] , "highlightFolderName" : params [ 'highlight-folder' ] , "configFolderName" : params [ 'config-folder' ] } } } ; return args ; }
Prepares the environment for kobold

@method prepareEnvironment
@param {string[]} argv
@return {string[]}
@private
Prepares the environment for kobold