Skip to content

Commit

Permalink
Add VERSION to stripe object (stripe#1021)
Browse files Browse the repository at this point in the history
  • Loading branch information
robz-stripe authored Sep 29, 2020
1 parent 5d4705a commit c42d3ca
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/stripe.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ function Stripe(key, config = {}) {
writable: false,
});

this.VERSION = Stripe.PACKAGE_VERSION;

this.on = this._emitter.on.bind(this._emitter);
this.once = this._emitter.once.bind(this._emitter);
this.off = this._emitter.removeListener.bind(this._emitter);
Expand Down
8 changes: 8 additions & 0 deletions test/stripe.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -519,4 +519,12 @@ describe('Stripe Module', function() {
});
});
});

describe('VERSION', () => {
it('should return the current package version', () => {
const newStripe = Stripe(testUtils.getUserStripeKey());

expect(newStripe.VERSION).to.equal(Stripe.PACKAGE_VERSION);
});
});
});

0 comments on commit c42d3ca

Please sign in to comment.