Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
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.
  • Loading branch information
John Haley committed Oct 23, 2014
commit 435924b16a354fb7c19816b09a6802a074daf843
28 changes: 28 additions & 0 deletions test/tests/cred.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var assert = require("assert");

describe("Cred", function() {
var NodeGit = require("../../");

it("can create default credentials", function() {
var defaultCreds = NodeGit.Cred.defaultNew();

assert(defaultCreds instanceof NodeGit.Cred);
});

it("can create ssh credentials using passed keys", function() {
var sshCreds
= NodeGit.Cred.sshKeyNew(
"username",
"public key",
"private key",
"passphrase");

assert(sshCreds instanceof NodeGit.Cred);
});

it("can create credentials using plaintext", function() {
var plaintextCreds = NodeGit.Cred.userpassPlaintextNew("username", "password");

assert(plaintextCreds instanceof NodeGit.Cred);
});
});