From b54f73c3bd6cf24ca7dcc92ddb9932dfbc44876b Mon Sep 17 00:00:00 2001 From: Rob Zimmerman Date: Mon, 28 Sep 2020 20:13:08 -0400 Subject: [PATCH] Add VERSION to stripe object --- lib/stripe.js | 2 ++ test/stripe.spec.js | 8 ++++++++ 2 files changed, 10 insertions(+) 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); + }); + }); });