Skip to content

Commit

Permalink
Expose internal methods
Browse files Browse the repository at this point in the history
  • Loading branch information
ivank committed Jun 16, 2017
1 parent d78cbb1 commit 7141f67
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mongoose-subscriptions-braintree",
"version": "1.3.8",
"version": "1.3.9",
"description": "Braintree processor for mongoose-subscriptions",
"main": "src/index.js",
"repository": "[email protected]:enhancv/mongoose-subscriptions-braintree.git",
Expand Down
6 changes: 6 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,10 @@ class BraintreeProcessor extends AbstractProcessor {
}
}

BraintreeProcessor.customer = customerProcessor;
BraintreeProcessor.address = addressProcessor;
BraintreeProcessor.paymentMethod = paymentMethodProcessor;
BraintreeProcessor.subscription = subscriptionProcessor;
BraintreeProcessor.transaction = transactionProcessor;

module.exports = BraintreeProcessor;
33 changes: 33 additions & 0 deletions test/integrationTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,39 @@ const processor = new BraintreeProcessor(gateway, [plan]);
describe(
"Customer",
database([Customer, Coupon], () => {
it("Should expose processors", function() {
assert.ok(BraintreeProcessor.customer.fields, "Should expose customer fields method");
assert.ok(
BraintreeProcessor.customer.processorFields,
"Should expose customer processorFields method"
);
assert.ok(BraintreeProcessor.address.fields, "Should expose address fields method");
assert.ok(
BraintreeProcessor.address.processorFields,
"Should expose address processorFields method"
);
assert.ok(
BraintreeProcessor.paymentMethod.fields,
"Should expose paymentMethod fields method"
);
assert.ok(
BraintreeProcessor.paymentMethod.processorFields,
"Should expose paymentMethod processorFields method"
);
assert.ok(
BraintreeProcessor.subscription.fields,
"Should expose subscription fields method"
);
assert.ok(
BraintreeProcessor.subscription.processorFields,
"Should expose subscription processorFields method"
);
assert.ok(
BraintreeProcessor.transaction.fields,
"Should expose transaction fields method"
);
});

it("Should be able to instantiate a Customer", function() {
this.timeout(20000);

Expand Down

0 comments on commit 7141f67

Please sign in to comment.