A JavaScript pet project that retrieve important info from the Stack Builders organization (or any org) repositories by using the GitHub API.
- Scrape all repositories from the Stack Builders organization from the GitHub API.
- For each repo, get its name, url, update date and stars.
- Get the repos data sorted by most recent updates (top 5).
- Get only the repos with more than 5 stars.
- Automated unit testing to check the fetched data, the sorting and filter functions work correctly.
Assuming you already have downloaded Node.JS and NPM: Clone or download the code and just run the following command on the directory:
npm install
Wait for the package installation.
npm run start
Wait for the execution of the code to get the fetched data as .json files.
By installing Jest and using the next command, you can validate all the fetched data is correct and all the functions work properly:
npm test
What the tests check:
- Checks if the fetching returns something valid.
- Checks if the getReposWithFiveStars works properly by checking each filtered repo.
- Checks if the getStarsSum add stars to the total count correctly.
- Checks if the sortReposByUpdateDate sorts each repo correctly by checking if the first repo update date is latest than the next one.