<commit_before>describe("indexSpec", function() {

	beforeEach(angular.mock.module('index'));

	it("rootScope", inject(function($rootScope,alertFactory) {
		expect($rootScope.BrewCalc).toBeDefined();
		expect($rootScope.version).toBeDefined();
		expect($rootScope.env).toBeDefined();
		expect($rootScope.color).toBeDefined();
		expect($rootScope.encodeName("Jose%")).toBe(encodeURIComponent("Jose%"));

		//Shared URL
		var ID = "Witbier-12121-12121"
		expect($rootScope.sharedUrl(ID)).toBe('http://server:80/share.html#/Witbier-12121-12121');

		var date = new Date(0);
		expect($rootScope.formatDate(date)).toBe('01/01/1970 01:00');
		
		// date = new Date();
		// expect($rootScope.formatDate(date)).toBe('Ahora');

		date = new Date();
		date.setSeconds(date.getSeconds()-10);
		expect($rootScope.formatDate(date)).toBe('Hace menos de un minuto');

		date = new Date();
		date.setSeconds(date.getSeconds()+10);
		expect($rootScope.formatDate(date)).toBe('En menos de un minuto');

		
		expect($rootScope.getAlerts().length).toBe(0);
		alertFactory.create("danger","Hola","Titulo");
		expect($rootScope.getAlerts().length).toBe(1);

	}));
});<commit_msg>test karma<commit_after>describe("indexSpec", function() {

	beforeEach(angular.mock.module('index'));

	it("rootScope", inject(function($rootScope,alertFactory) {
		expect($rootScope.BrewCalc).toBeDefined();
		expect($rootScope.version).toBeDefined();
		expect($rootScope.env).toBeDefined();
		expect($rootScope.color).toBeDefined();
		expect($rootScope.encodeName("Jose%")).toBe(encodeURIComponent("Jose%"));

		//Shared URL
		var ID = "Witbier-12121-12121"
		expect($rootScope.sharedUrl(ID)).toBe('http://server:80/share.html#/Witbier-12121-12121');

		// var date = new Date(0);
		// expect($rootScope.formatDate(date)).toBe('01/01/1970 01:00');
		
		// date = new Date();
		// expect($rootScope.formatDate(date)).toBe('Ahora');

		date = new Date();
		date.setSeconds(date.getSeconds()-50);
		expect($rootScope.formatDate(date)).toBe('Hace menos de un minuto');

		date = new Date();
		date.setSeconds(date.getSeconds()+50);
		expect($rootScope.formatDate(date)).toBe('En menos de un minuto');

		
		expect($rootScope.getAlerts().length).toBe(0);
		alertFactory.create("danger","Hola","Titulo");
		expect($rootScope.getAlerts().length).toBe(1);

	}));
});
{'fraction_non_alphanumeric': 0.2054380664652568, 'fraction_numerical': 0.035390591281829954, 'mean_word_length': 5.777777777777778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '3054185', 'n_tokens_mistral': 899, 'n_tokens_neox': 780, 'n_words': 95}