Skip to content

Instantly share code, notes, and snippets.

@mcai4gl2
Created December 27, 2014 22:02
Show Gist options
  • Save mcai4gl2/d32a985b695ef58cd31b to your computer and use it in GitHub Desktop.
Save mcai4gl2/d32a985b695ef58cd31b to your computer and use it in GitHub Desktop.
Example to access Github API using github.js
QUnit.test('Read user details', function() {
var github = ghClient.Github;
var user = github.getUser();
console.log(user);
QUnit.ok(user, "User shall not be undefined");
QUnit.stop();
user.show("mcai4gl2", function(err, user) {
if (err) {
console.log(err);
} else {
console.log(user);
var login = user.login;
QUnit.equal("mcai4gl2", login, "Username shall be mcai4gl2");
}
});
setTimeout(function() {
start();
}, 1000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment