Skip to content

Commit 4b33458

Browse files
committed
Added error code & return code tests
1 parent 2f2e10d commit 4b33458

1 file changed

Lines changed: 34 additions & 0 deletions

File tree

test/convenience-error.js

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,40 @@ exports.method = function(test){
3434
test.done();
3535
};
3636

37+
exports.codes = function(test) {
38+
test.expect(14);
39+
var error = new git.error();
40+
test.equal(error.codes.GITERR_NOMEMORY, git.raw.Error.codes.GITERR_NOMEMORY, 'GITERR_NOMEMORY code should match expected value');
41+
test.equal(error.codes.GITERR_OS, git.raw.Error.codes.GITERR_OS, 'GITERR_OS code should match expected value');
42+
test.equal(error.codes.GITERR_INVALID, git.raw.Error.codes.GITERR_INVALID, 'GITERR_INVALID code should match expected value');
43+
test.equal(error.codes.GITERR_REFERENCE, git.raw.Error.codes.GITERR_REFERENCE, 'GITERR_REFERENCE code should match expected value');
44+
test.equal(error.codes.GITERR_ZLIB, git.raw.Error.codes.GITERR_ZLIB, 'GITERR_ZLIB code should match expected value');
45+
test.equal(error.codes.GITERR_REPOSITORY, git.raw.Error.codes.GITERR_REPOSITORY, 'GITERR_REPOSITORY code should match expected value');
46+
test.equal(error.codes.GITERR_CONFIG, git.raw.Error.codes.GITERR_CONFIG, 'GITERR_CONFIG code should match expected value');
47+
test.equal(error.codes.GITERR_REGEX, git.raw.Error.codes.GITERR_REGEX, 'GITERR_REGEX code should match expected value');
48+
test.equal(error.codes.GITERR_ODB, git.raw.Error.codes.GITERR_ODB, 'GITERR_ODB code should match expected value');
49+
test.equal(error.codes.GITERR_INDEX, git.raw.Error.codes.GITERR_INDEX, 'GITERR_INDEX code should match expected value');
50+
test.equal(error.codes.GITERR_OBJECT, git.raw.Error.codes.GITERR_OBJECT, 'GITERR_OBJECT code should match expected value');
51+
test.equal(error.codes.GITERR_NET, git.raw.Error.codes.GITERR_NET, 'GITERR_NET code should match expected value');
52+
test.equal(error.codes.GITERR_TAG, git.raw.Error.codes.GITERR_TAG, 'GITERR_TAG code should match expected value');
53+
test.equal(error.codes.GITERR_TREE, git.raw.Error.codes.GITERR_TREE, 'GITERR_TREE code should match expected value');
54+
test.done();
55+
};
56+
57+
exports.returnCodes = function(test) {
58+
test.expect(8);
59+
var error = new git.error();
60+
test.equal(error.returnCodes.GIT_OK, git.raw.Error.returnCodes.GIT_OK, 'GIT_OK return code should match expected value');
61+
test.equal(error.returnCodes.GIT_ERROR, git.raw.Error.returnCodes.GIT_ERROR, 'GIT_ERROR return code should match expected value');
62+
test.equal(error.returnCodes.GIT_ENOTFOUND, git.raw.Error.returnCodes.GIT_ENOTFOUND, 'GIT_ENOTFOUND return code should match expected value');
63+
test.equal(error.returnCodes.GIT_EEXISTS, git.raw.Error.returnCodes.GIT_EEXISTS, 'GIT_EEXISTS return code should match expected value');
64+
test.equal(error.returnCodes.GIT_EAMBIGUOUS, git.raw.Error.returnCodes.GIT_EAMBIGUOUS, 'GIT_EAMBIGUOUS return code should match expected value');
65+
test.equal(error.returnCodes.GIT_EBUFS, git.raw.Error.returnCodes.GIT_EBUFS, 'GIT_EBUFS return code should match expected value');
66+
test.equal(error.returnCodes.GIT_PASSTHROUGH, git.raw.Error.returnCodes.GIT_PASSTHROUGH, 'GIT_PASSTHROUGH return code should match expected value');
67+
test.equal(error.returnCodes.GIT_ITEROVER, git.raw.Error.returnCodes.GIT_ITEROVER, 'GIT_ITEROVER return code should match expected value');
68+
test.done();
69+
};
70+
3771
/**
3872
* Test that
3973
*

0 commit comments

Comments
 (0)