diff options
author | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
---|---|---|
committer | Hsuan Lee <hsuan@cobinhood.com> | 2019-01-19 18:42:04 +0800 |
commit | 7ae38906926dc09bc10670c361af0d2bf0050426 (patch) | |
tree | 5fb10ae366b987db09e4ddb4bc3ba0f75404ad08 /packages/pipeline/test/parsers/ohlcv_external | |
parent | b5fd3c72a08aaa6957917d74c333387a16edf66b (diff) | |
download | dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.gz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.bz2 dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.lz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.xz dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.tar.zst dexon-sol-tools-7ae38906926dc09bc10670c361af0d2bf0050426.zip |
Update dependency packages
Diffstat (limited to 'packages/pipeline/test/parsers/ohlcv_external')
-rw-r--r-- | packages/pipeline/test/parsers/ohlcv_external/crypto_compare_test.ts | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/packages/pipeline/test/parsers/ohlcv_external/crypto_compare_test.ts b/packages/pipeline/test/parsers/ohlcv_external/crypto_compare_test.ts deleted file mode 100644 index 118cafc5e..000000000 --- a/packages/pipeline/test/parsers/ohlcv_external/crypto_compare_test.ts +++ /dev/null @@ -1,62 +0,0 @@ -import * as chai from 'chai'; -import 'mocha'; -import * as R from 'ramda'; - -import { CryptoCompareOHLCVRecord } from '../../../src/data_sources/ohlcv_external/crypto_compare'; -import { OHLCVExternal } from '../../../src/entities'; -import { OHLCVMetadata, parseRecords } from '../../../src/parsers/ohlcv_external/crypto_compare'; -import { chaiSetup } from '../../utils/chai_setup'; - -chaiSetup.configure(); -const expect = chai.expect; - -// tslint:disable:custom-no-magic-numbers -describe('ohlcv_external parser (Crypto Compare)', () => { - describe('parseRecords', () => { - const record: CryptoCompareOHLCVRecord = { - time: 200, - close: 100, - high: 101, - low: 99, - open: 98, - volumefrom: 1234, - volumeto: 4321, - }; - - const metadata: OHLCVMetadata = { - fromSymbol: 'ETH', - toSymbol: 'ZRX', - exchange: 'CCCAGG', - source: 'CryptoCompare', - observedTimestamp: new Date().getTime(), - interval: 100000, - }; - - const entity = new OHLCVExternal(); - entity.exchange = metadata.exchange; - entity.fromSymbol = metadata.fromSymbol; - entity.toSymbol = metadata.toSymbol; - entity.startTime = 100000; - entity.endTime = 200000; - entity.open = record.open; - entity.close = record.close; - entity.low = record.low; - entity.high = record.high; - entity.volumeFrom = record.volumefrom; - entity.volumeTo = record.volumeto; - entity.source = metadata.source; - entity.observedTimestamp = metadata.observedTimestamp; - - it('converts Crypto Compare OHLCV records to OHLCVExternal entity', () => { - const input = [record, R.merge(record, { time: 300 }), R.merge(record, { time: 400 })]; - const expected = [ - entity, - R.merge(entity, { startTime: 200000, endTime: 300000 }), - R.merge(entity, { startTime: 300000, endTime: 400000 }), - ]; - - const actual = parseRecords(input, metadata); - expect(actual).deep.equal(expected); - }); - }); -}); |