Skip to content

Commit 491149a

Browse files
committed
fix: expose additional types
1 parent c9f44c5 commit 491149a

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ export { Payment, PaymentRequest } from "./collections";
22
export { Transfer, TransferRequest } from "./disbursements";
33
export * from "./errors";
44
export {
5-
PartyIdType,
5+
PartyIdType as PayerType,
66
Party as Payer,
7+
TransactionStatus as Status,
8+
Balance,
79
Environment,
810
FailureReason,
911
GlobalConfig,

test/index.test.ts

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { AssertionError } from "assert";
2+
3+
import * as momo from "../src";
4+
5+
import { expect } from "./chai";
6+
7+
describe("MomoClient", function() {
8+
describe("#create", function() {
9+
context("when there is no callback host", function() {
10+
it("throws an error", function() {
11+
expect(momo.create.bind(null, {})).to.throw(AssertionError);
12+
});
13+
});
14+
15+
context("when there is a callback host", function() {
16+
it("throws doesn't throw an error", function() {
17+
expect(
18+
momo.create.bind(null, { callbackHost: "example.com" })
19+
).to.not.throw();
20+
});
21+
22+
it("returns a creator for Collections client", function() {
23+
expect(momo.create({ callbackHost: "example.com" }))
24+
.to.have.property("Collections")
25+
.that.is.a("function");
26+
});
27+
28+
it("returns a creator for Disbursements client", function() {
29+
expect(momo.create({ callbackHost: "example.com" }))
30+
.to.have.property("Disbursements")
31+
.that.is.a("function");
32+
});
33+
});
34+
});
35+
});

0 commit comments

Comments
 (0)