forked from github-tools/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathauth_test.js
More file actions
31 lines (27 loc) · 720 Bytes
/
auth_test.js
File metadata and controls
31 lines (27 loc) · 720 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
if (typeof require !== 'undefined') {
var Github = require("../")
, chai = require("chai");
}
chai.should();
var expect = chai.expect
, TEST_USERNAME = "mikedeboertest"
, TEST_PASSWORD = "test1324";
// var util = require("util");
describe("Auth", function(){
this.timeout(10000);
it("should authenticate with basic auth", function(done){
var github = new Github({
username: TEST_USERNAME,
password: TEST_PASSWORD,
auth: "basic"
});
var user = github.getUser();
user.repos(function(err, repos) {
// console.error(util.inspect(err));
expect(err).to.be.null;
repos.should.be.ok;
repos.length.should.be.above(1);
done();
});
});
});