Create function coinList() to get list of coins from CryptoCompare API#10
Conversation
e7d9603 to
9200b6f
Compare
RyanZim
left a comment
There was a problem hiding this comment.
Tests & linter are failing, please fix this. I left two comments below pointing out some of the problems.
| }) | ||
| } | ||
|
|
||
| function coinList() { |
There was a problem hiding this comment.
This function needs to be exported at the bottom of the file.
| const helpers = require('./helpers') | ||
|
|
||
| test('coinList()', t => { | ||
| t.plan(2) |
There was a problem hiding this comment.
This will make tests fail.
|
@RyanZim tests seem to still be failing? Is this a problem with the node version? |
|
@owencraston The linter errors still aren't fixed, please run |
ba1b036 to
fd51081
Compare
|
@RyanZim Does this look good to you? |
RyanZim
left a comment
There was a problem hiding this comment.
Looks good overall; though I'm not sure if we want package-lock.json committed to the repo; @jprichardson?
There was a problem hiding this comment.
Sorry, reviewed too quickly, there are broken tests here. Our travis config was messed up, so travis didn't run all the tests right. I fixed that in master.
Please rebase this onto master, and fix the tests as outlined below. Also talked to JP about this, we don't want the package-lock.json committed here, so remove that; also remove your changes to CHANGELOG while you're at it.
| t.strictEqual(typeof coins.Data.ETH.Name, 'string', 'coins.Data.ETH.Name` is a string') | ||
| t.strictEqual(typeof coins.Data.ETH.Name, 'ETH', 'coins.Data.ETH.Name is \'ETH\'') | ||
| t.strictEqual(typeof coins.Data.ETH.FullName, 'Ethereum (ETH)', 'coins.Data.ETH.FullName is \'Ethereum (ETH)\'') | ||
| t.strictEqual(typeof coins.Data.ETH.Sponsored, false, 'coins.Data.ETH.Sponsored is \'false\'') |
There was a problem hiding this comment.
You don't want typeof here, except for the top assertion.
|
Based on this doc I think I should remove it: https://docs.npmjs.com/files/package-lock.json |
fd51081 to
8150d8a
Compare
|
Why are these tests still failing? @RyanZim |
|
Not sure, will take a look later. |
RyanZim
left a comment
There was a problem hiding this comment.
Your URL is wrong; that's why the tests are failing.
| } | ||
|
|
||
| function coinList () { | ||
| const url = `${baseUrl}coinlist/` |
There was a problem hiding this comment.
Should be:
const url = `${baseUrl}all/coinlist`
There was a problem hiding this comment.
Right. I made this change but the tests are still failing.
8150d8a to
25b53bf
Compare
|
@owencraston You need to remove the trailing slash from the URL. CryptoCompare doesn't like it. |
- the coin list data is now available at https://min-api.cryptocompare.com/data/all/coinlist - more information can be found here: https://www.cryptocompare.com/api/#-api-data-coinlist- - write tests for this function - add documentation
25b53bf to
8c7becb
Compare
|
Thanks for all the help @RyanZim. Sorry this took so long. I think it should be good to go! I rebased all the commits into one atomic commit just for simplicity. |
RyanZim
left a comment
There was a problem hiding this comment.
utACK LGTM, @jprichardson?
|
@RyanZim please release update to npm. |
|
Thanks @owencraston! |
|
🚀 |
|
Released as 0.3.0 🎉 |
I needed to get a list of coins from CryptoCompare so I thought I'd abstract it into this library.
https://www.cryptocompare.com/api/#-api-data-coinlist-
cc @RyanZim