Skip to content

Commit

Permalink
Merge 56b94f3 into c9f44c5
Browse files Browse the repository at this point in the history
  • Loading branch information
ernest-okot committed Feb 16, 2019
2 parents c9f44c5 + 56b94f3 commit 2dba6b5
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ export { Payment, PaymentRequest } from "./collections";
export { Transfer, TransferRequest } from "./disbursements";
export * from "./errors";
export {
PartyIdType,
PartyIdType as PayerType,
Party as Payer,
TransactionStatus as Status,
Balance,
Environment,
FailureReason,
GlobalConfig,
Expand Down
35 changes: 35 additions & 0 deletions test/index.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { AssertionError } from "assert";

import * as momo from "../src";

import { expect } from "./chai";

describe("MomoClient", function() {
describe("#create", function() {
context("when there is no callback host", function() {
it("throws an error", function() {
expect(momo.create.bind(null, {})).to.throw(AssertionError);
});
});

context("when there is a callback host", function() {
it("throws doesn't throw an error", function() {
expect(
momo.create.bind(null, { callbackHost: "example.com" })
).to.not.throw();
});

it("returns a creator for Collections client", function() {
expect(momo.create({ callbackHost: "example.com" }))
.to.have.property("Collections")
.that.is.a("function");
});

it("returns a creator for Disbursements client", function() {
expect(momo.create({ callbackHost: "example.com" }))
.to.have.property("Disbursements")
.that.is.a("function");
});
});
});
});

0 comments on commit 2dba6b5

Please sign in to comment.