{"size": 1008, "ext": "js", "max_stars_repo_path": "test/test06_load.js", "max_stars_repo_name": "AlexShkunov/flexi-cache", "max_stars_repo_stars_event_min_datetime": "2019-10-03T21:01:06.000Z", "max_stars_repo_stars_event_max_datetime": "2019-10-03T21:01:06.000Z", "max_issues_repo_path": "test/test06_load.js", "max_issues_repo_name": "AlexShkunov/lean-cache", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/test06_load.js", "max_forks_repo_name": "AlexShkunov/lean-cache", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.3793103448, "max_line_length": 55, "alphanum_fraction": 0.5625}

// ## dependencies
var expect = require('chai').expect;
var path = require('path');
var proxyquire = require('proxyquire');

// config
var moduleName = path.basename(__filename);

// funcs
var print = function(...msg){
	msg[0] = moduleName + ' [TESTRUN] >> ' + msg[0];
	return console.log(...msg);
};

// target
var dirLevelUp = '../';
var unit = require(dirLevelUp + 'index.js');

// flow
describe('load', function(){
	
	var cache = null;
	
	it('optional', function(done){
		
		cache = new unit({
			size: 5,
			ttl: 2,
			interval: 1
		});
		
		var result = cache.set('1', 'abc');
		print('set 1 - result = %s', result);
		expect(result).to.equal(true);
		
		cache.get('1', function(err, body){
			print('get 1 - err = %s | body = %j', err, body);
			expect(err).to.equal(null);
			expect(body).to.equal('abc');
			
			cache.get('2', function(err2, body2){
				print('get 2 - err = %s | body = %s', err2, body2);
				expect(body2).to.equal(null);
				
				done();
				
			});
			
		});
		
		
	});
	
});


