diff --git a/lib/stripe.js b/lib/stripe.js index 9ceff5915a..b330b84429 100644 --- a/lib/stripe.js +++ b/lib/stripe.js @@ -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); diff --git a/test/stripe.spec.js b/test/stripe.spec.js index 2de0474678..179459bdbc 100644 --- a/test/stripe.spec.js +++ b/test/stripe.spec.js @@ -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); + }); + }); });