Skip to content

Commit

Permalink
Rename local stripe to newStripe in stripe.spec.js
Browse files Browse the repository at this point in the history
  • Loading branch information
anniel-stripe committed Nov 1, 2022
1 parent 4870c39 commit 7567f54
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/stripe.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ describe('Stripe Module', function() {
});

cases.forEach((item) => {
const stripe = Stripe(testUtils.getUserStripeKey(), item);
expect(stripe.getApiField('version')).to.equal(null);
const newStripe = Stripe(testUtils.getUserStripeKey(), item);
expect(newStripe.getApiField('version')).to.equal(null);
});
});

Expand Down Expand Up @@ -178,22 +178,22 @@ describe('Stripe Module', function() {
it('Should include whether typescript: true was passed, respecting reinstantiations', () => {
return new Promise((resolve) => resolve())
.then(() => {
const stripe = new Stripe('sk_test_123', {
const newStripe = new Stripe('sk_test_123', {
typescript: true,
});
return expect(
new Promise((resolve, reject) => {
stripe.getClientUserAgent((c) => {
newStripe.getClientUserAgent((c) => {
resolve(JSON.parse(c));
});
})
).to.eventually.have.property('typescript', 'true');
})
.then(() => {
const stripe = new Stripe('sk_test_123', {});
const newStripe = new Stripe('sk_test_123', {});
return expect(
new Promise((resolve, reject) => {
stripe.getClientUserAgent((c) => {
newStripe.getClientUserAgent((c) => {
resolve(JSON.parse(c));
});
})
Expand Down Expand Up @@ -282,16 +282,16 @@ describe('Stripe Module', function() {
expect(stripe.getApiField('timeout')).to.equal(defaultTimeout);
});
it('Should allow me to set a custom timeout', () => {
const stripe = Stripe('sk_test', {
const newStripe = Stripe('sk_test', {
timeout: 900,
});
expect(stripe.getApiField('timeout')).to.equal(900);
expect(newStripe.getApiField('timeout')).to.equal(900);
});
it('Should allow me to set null, to reset to the default', () => {
const stripe = Stripe('sk_test', {
const newStripe = Stripe('sk_test', {
timeout: null,
});
expect(stripe.getApiField('timeout')).to.equal(defaultTimeout);
expect(newStripe.getApiField('timeout')).to.equal(defaultTimeout);
});
});

Expand Down Expand Up @@ -390,7 +390,7 @@ describe('Stripe Module', function() {
});

it('should ignore any invalid properties', () => {
const stripe = Stripe('sk_test', {
const newStripe = Stripe('sk_test', {
appInfo: {
name: 'MyAwesomeApp',
partner_id: 'partner_1234',
Expand All @@ -399,7 +399,7 @@ describe('Stripe Module', function() {
countOfRadishes: 512,
},
});
expect(stripe._appInfo).to.eql({
expect(newStripe._appInfo).to.eql({
name: 'MyAwesomeApp',
partner_id: 'partner_1234',
version: '1.2.345',
Expand All @@ -415,14 +415,14 @@ describe('Stripe Module', function() {
url: 'https://myawesomeapp.info',
};

const stripe = Stripe('sk_test', {
const newStripe = Stripe('sk_test', {
appInfo,
});

stripe.getClientUserAgent((uaString) => {
newStripe.getClientUserAgent((uaString) => {
expect(JSON.parse(uaString).application).to.eql(appInfo);

expect(stripe.getAppInfoAsString()).to.eql(
expect(newStripe.getAppInfoAsString()).to.eql(
`${appInfo.name}/${appInfo.version} (${appInfo.url})`
);

Expand Down

0 comments on commit 7567f54

Please sign in to comment.