An app that uses stock ticker symbols to report the stock’s price and its recorded number of ¨likes¨. The app also allows comparing two stocks to see their relative number of likes (i.e. which stock is most popular between the two, and by how much).
I built this app for freeCodeCamp’s fourth Information Security and Quality Assurance Projects.
FreeCodeCamp proposed using Google Finance’s API to retrieve stock price data; unfortunately, this API has not been accessible for some time. Instead, I chose to use Alpha Vantage for the project. The limits imposed by this service (5 request per minute) seriously complicated the test cases I wrote in Chai/Mocha. To resolve the issue, I implemented an
afterEach() function containing a 20 second
setTimeout() delay. This was designed to reduce the test suite to less than 5 API requests per minute.
This project also saw me learn how to pass headers (
.set()) and query parameters (
.query()) in my Chai tests, a lesson that took me unfortunately longer than expected to figure out, but that I’m sure will prove itself very useful in the future.
The brief for the Stock Price Checker project was as follows: