{"size": 823, "ext": "js", "max_stars_repo_path": "tests/select.test.js", "max_stars_repo_name": "emilwerner/Arrayextensions", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "tests/select.test.js", "max_issues_repo_name": "emilwerner/Arrayextensions", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "tests/select.test.js", "max_forks_repo_name": "emilwerner/Arrayextensions", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 29.3928571429, "max_line_length": 106, "alphanum_fraction": 0.659781288}

describe("Select is implemented correctly", function() {
	it("Select exists", function() {
		expect([].select).toBeDefined();
	});

	it("Select without argument throws error", function() {
		expect([].select).toThrow(new Error("Argument for Select is required"));
	});
	it("Select on empty array returns empty array", function() {
		expect([].select(function(item){
			return item === "whatever"
		}).length).toEqual(0);
	});

	it("Selects age from personarray", function() {
		var personArray = [{name:"Emil", age: 24},{name:"Anders", age: 19},{name:"Per", age: 21},{name:"Bert"}];
		var ageArray = personArray.select(function(person){
			return person.age;
		});
		expect(ageArray[0]).toEqual(24);
		expect(ageArray[1]).toEqual(19);
		expect(ageArray[2]).toEqual(21);
		expect(ageArray[3]).toEqual(undefined);
	});


});