Skip to content

Commit b4b55ba

Browse files
committed
Test verifies .commit() error handling
1 parent 6cc76ba commit b4b55ba

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

test/commit_test.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
if (typeof require !== 'undefined') {
2+
var Github = require("../")
3+
, chai = require("chai");
4+
}
5+
chai.should();
6+
var expect = chai.expect
7+
, TEST_USERNAME = "mikedeboertest"
8+
, TEST_PASSWORD = "test1324"
9+
, TEST_REPO = "github";
10+
11+
var github = new Github({
12+
username: TEST_USERNAME,
13+
password: TEST_PASSWORD,
14+
auth: "basic"
15+
});
16+
17+
describe("Repo", function(){
18+
19+
it("should return commit errors correctly", function(done){
20+
var repo = github.getRepo(TEST_USERNAME, TEST_REPO);
21+
repo.commit("broken-parent-hash", "broken-tree-hash", "commit message", function(err){
22+
done();
23+
});
24+
});
25+
26+
});

test/test_runner.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<script src="../node_modules/chai/chai.js"></script>
1414
<script>mocha.setup('bdd')</script>
1515
<script src="auth_test.js"></script>
16+
<script src="commit_test.js"></script>
1617
<script>
1718
mocha.checkLeaks();
1819
mocha.globals(['_', 'Github']);

0 commit comments

Comments
 (0)