Skip to content

Commit 769908d

Browse files
author
John Haley
committed
Changed the cred methods over to be async promises
This should pass tests after then/promises#58 is fixed.
1 parent b22ba10 commit 769908d

1 file changed

Lines changed: 15 additions & 15 deletions

File tree

test/tests/cred.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,26 @@ describe("Cred", function() {
44
var NodeGit = require("../../");
55

66
it("can create default credentials", function() {
7-
var defaultCreds = NodeGit.Cred.defaultNew();
8-
9-
assert(defaultCreds instanceof NodeGit.Cred);
7+
NodeGit.Cred.defaultNew().then(function (defaultCreds) {
8+
assert(defaultCreds instanceof NodeGit.Cred);
9+
});
1010
});
1111

1212
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);
13+
NodeGit.Cred.sshKeyNew(
14+
"username",
15+
"public key",
16+
"private key",
17+
"passphrase")
18+
.then(function (sshCreds) {
19+
assert(sshCreds instanceof NodeGit.Cred);
20+
});
2121
});
2222

2323
it("can create credentials using plaintext", function() {
24-
var plaintextCreds
25-
= NodeGit.Cred.userpassPlaintextNew("username", "password");
26-
27-
assert(plaintextCreds instanceof NodeGit.Cred);
24+
NodeGit.Cred.userpassPlaintextNew("username", "password")
25+
.then(function (plaintextCreds) {
26+
assert(plaintextCreds instanceof NodeGit.Cred);
27+
});
2828
});
2929
});

0 commit comments

Comments
 (0)