-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* v3.0.0rc1 release * fixing import issue and update pipeline * update example code
- Loading branch information
Showing
108 changed files
with
5,333 additions
and
10,362 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 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 |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules | ||
dist | ||
docs | ||
coverage | ||
coverage | ||
report.json |
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
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
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 |
---|---|---|
@@ -1,13 +1,10 @@ | ||
/* global describe, it, expect */ | ||
const { SpotClient, mockSubscription, mockConnection } = require('../testUtils/testSetup') | ||
/* global describe, it */ | ||
const { mockSubscription } = require('../testUtils/testSetup') | ||
const { mockResponse } = require('../testUtils/mockData') | ||
|
||
describe('#aggTrade', () => { | ||
it('should get aggregate trade data', () => { | ||
const symbol = 'BNBUSDT' | ||
mockSubscription(`/ws/${symbol.toLowerCase()}@aggTrade`, mockResponse) | ||
mockConnection(SpotClient, 'aggTradeWS', symbol)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,20 +1,14 @@ | ||
/* global describe, it, expect */ | ||
const { SpotClient, mockSubscription, mockConnection } = require('../testUtils/testSetup') | ||
/* global describe, it */ | ||
const { mockSubscription } = require('../testUtils/testSetup') | ||
const { mockResponse } = require('../testUtils/mockData') | ||
|
||
describe('#bookTicker', () => { | ||
it('should get bookTicker data', () => { | ||
const symbol = 'BNBUSDT' | ||
mockSubscription(`/ws/${symbol.toLowerCase()}@bookTicker`, mockResponse) | ||
mockConnection(SpotClient, 'bookTickerWS', symbol)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
|
||
it('should get all bookTicker data', () => { | ||
mockSubscription('/ws/!bookTicker', mockResponse) | ||
mockConnection(SpotClient, 'bookTickerWS', null)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,21 +1,15 @@ | ||
/* global describe, it, expect */ | ||
const { SpotClient, mockSubscription, mockConnection } = require('../testUtils/testSetup') | ||
/* global describe, it */ | ||
const { mockSubscription } = require('../testUtils/testSetup') | ||
const { mockResponse } = require('../testUtils/mockData') | ||
|
||
describe('#combinedStreams', () => { | ||
it('should get combined stream data with single stream', () => { | ||
const stream = 'btcusdt@miniTicker' | ||
mockSubscription(`/stream?streams=${stream}`, mockResponse) | ||
mockConnection(SpotClient, 'combinedStreams', stream)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
|
||
it('should get combined stream data', () => { | ||
const streams = ['btcusdt@miniTicker', 'ethusdt@ticker'] | ||
mockSubscription(`/stream?streams=${streams.join('/')}`, mockResponse) | ||
mockConnection(SpotClient, 'combinedStreams', streams)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
/* global describe, it, expect */ | ||
const { SpotClient, mockSubscription, mockConnection } = require('../testUtils/testSetup') | ||
/* global describe, it */ | ||
const { mockSubscription } = require('../testUtils/testSetup') | ||
const { mockResponse } = require('../testUtils/mockData') | ||
|
||
describe('#diffBookDepth', () => { | ||
it('should get diffBookDepth data', () => { | ||
const symbol = 'BNBUSDT' | ||
const speed = '1000ms' | ||
mockSubscription(`/ws/${symbol.toLowerCase()}@depth@${speed}`, mockResponse) | ||
mockConnection(SpotClient, 'diffBookDepth', symbol, speed)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
}) |
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
/* global describe, it, expect */ | ||
const { SpotClient, mockSubscription, mockConnection } = require('../testUtils/testSetup') | ||
/* global describe, it */ | ||
const { mockSubscription } = require('../testUtils/testSetup') | ||
const { mockResponse } = require('../testUtils/mockData') | ||
|
||
describe('#kline', () => { | ||
it('should get kline data', () => { | ||
const symbol = 'BNBUSDT' | ||
const interval = '1m' | ||
mockSubscription(`/ws/${symbol.toLowerCase()}@kline_${interval}`, mockResponse) | ||
mockConnection(SpotClient, 'klineWS', symbol, interval)(data => { | ||
expect(data).toEqual([mockResponse]) | ||
}) | ||
}) | ||
}) |
Oops, something went wrong.