{"size": 736, "ext": "js", "max_stars_repo_path": "test/users.search.js", "max_stars_repo_name": "CREBP/exlibris", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/users.search.js", "max_issues_repo_name": "CREBP/exlibris", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/users.search.js", "max_forks_repo_name": "CREBP/exlibris", "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": 21.6470588235, "max_line_length": 58, "alphanum_fraction": 0.6032608696}
var config = require('./config');
var exlibris = require('..');
var expect = require('chai').expect;

describe('users.search()', function() {

	var el;
	before('init exlibris object', ()=> el = new exlibris());

	it('should return the first 10 users', function(finish) {
		this.timeout(30 * 1000);

		el
			.setKey(config.apikey)
			.setRegion('apac')
			.users.search({limit: 10}, function(err, res) {
				expect(err).to.be.not.ok;

				expect(res).to.be.an.array;
				expect(res).to.have.length(10);

				res.forEach(u => {
					expect(u).to.have.property('id');
					expect(u).to.have.property('url');
					expect(u).to.have.property('firstName');
					expect(u).to.have.property('lastName');
				});

				finish();
			});
	});

});
