-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from binance/rc-v3.5.0
Release v3.5.0
- Loading branch information
Showing
71 changed files
with
689 additions
and
1,903 deletions.
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,40 @@ | ||
/* global describe, it, expect */ | ||
const MissingParameterError = require('../../../src/error/missingParameterError') | ||
const { nockPostMock, buildQueryString, SpotClient } = require('../../testUtils/testSetup') | ||
|
||
const { | ||
mockResponse | ||
} = require('../../testUtils/mockData') | ||
|
||
const baseToken = 'USDT' | ||
const faceToken = 'BNB' | ||
const baseTokenAmount = 10 | ||
|
||
describe('#giftCardBuyCode', () => { | ||
it('missing baseToken', () => { | ||
expect(() => { | ||
SpotClient.giftCardBuyCode('', faceToken, baseTokenAmount) | ||
}).toThrow(MissingParameterError) | ||
}) | ||
|
||
it('missing faceToken', () => { | ||
expect(() => { | ||
SpotClient.giftCardBuyCode(baseToken, '', baseTokenAmount) | ||
}).toThrow(MissingParameterError) | ||
}) | ||
|
||
it('missing baseTokenAmount', () => { | ||
expect(() => { | ||
SpotClient.giftCardBuyCode(baseToken, faceToken, '') | ||
}).toThrow(MissingParameterError) | ||
}) | ||
|
||
it('should return binance code info', () => { | ||
nockPostMock(`/sapi/v1/giftcard/buyCode?${buildQueryString({ baseToken, faceToken, baseTokenAmount })}`)(mockResponse) | ||
|
||
return SpotClient.giftCardBuyCode(baseToken, faceToken, baseTokenAmount).then(response => { | ||
expect(response).toBeDefined() | ||
expect(response.data).toEqual(mockResponse) | ||
}) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.