Skip to content

Commit 435924b

Browse files
author
John Haley
committed
Added a few unit tests for credentials
These just confirm that the credentials are actually created not that we can do anything with them right now.
1 parent 31f36b5 commit 435924b

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

test/tests/cred.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
var assert = require("assert");
2+
3+
describe("Cred", function() {
4+
var NodeGit = require("../../");
5+
6+
it("can create default credentials", function() {
7+
var defaultCreds = NodeGit.Cred.defaultNew();
8+
9+
assert(defaultCreds instanceof NodeGit.Cred);
10+
});
11+
12+
it("can create ssh credentials using passed keys", function() {
13+
var sshCreds
14+
= NodeGit.Cred.sshKeyNew(
15+
"username",
16+
"public key",
17+
"private key",
18+
"passphrase");
19+
20+
assert(sshCreds instanceof NodeGit.Cred);
21+
});
22+
23+
it("can create credentials using plaintext", function() {
24+
var plaintextCreds = NodeGit.Cred.userpassPlaintextNew("username", "password");
25+
26+
assert(plaintextCreds instanceof NodeGit.Cred);
27+
});
28+
});

0 commit comments

Comments
 (0)