forked from stripe/stripe-node
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Do not mutate user-supplied opts (stripe#1041)
- Loading branch information
1 parent
54c99ed
commit bbefa30
Showing
2 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
require('../testUtils'); | ||
|
||
const makeRequest = require('../lib/makeRequest'); | ||
const expect = require('chai').expect; | ||
|
||
describe('makeRequest', () => { | ||
describe('args', () => { | ||
it('does not mutate user-supplied deprecated opts', () => { | ||
const args = [ | ||
{ | ||
stripe_account: 'bad', | ||
}, | ||
]; | ||
const mockSelf = { | ||
createResourcePathWithSymbols: () => {}, | ||
createFullPath: () => {}, | ||
_request: () => {}, | ||
}; | ||
makeRequest(mockSelf, args, {}, {}); | ||
expect(args).to.deep.equal([ | ||
{ | ||
stripe_account: 'bad', | ||
}, | ||
]); | ||
}); | ||
}); | ||
}); |