forked from github-tools/github
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.issue.js
More file actions
35 lines (30 loc) · 909 Bytes
/
test.issue.js
File metadata and controls
35 lines (30 loc) · 909 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
32
33
34
35
'use strict';
var Github = require('../src/github.js');
var testUser = require('./user.json');
var github, issues;
describe('Github.Issue', function() {
before(function() {
github = new Github({
username: testUser.USERNAME,
password: testUser.PASSWORD,
auth: 'basic'
});
issues = github.getIssues(testUser.USERNAME, 'TestRepo');
});
it('should list issues', function(done) {
issues.list({}, function(err, issues) {
should.not.exist(err);
issues.should.have.length.above(0);
done();
});
});
it('should post issue comment', function(done) {
issues.list({}, function(err, issuesList) {
issues.comment(issuesList[0], 'Comment test', function(err, res) {
should.not.exist(err);
res.body.should.equal('Comment test');
done();
});
});
});
});