Posts

Showing posts from November, 2020

Code Testing

Image
In order to enhance the DLCheck tool, code testing is mandatory, it ensures the codes' behavior to a certain extent and allows the contributors to discover bugs as they try to update the tool. The tools I chose to perform testing with my code is Jest , combined with the nock  npm module.  I chose to use Jest because it is one of the most popular testing frameworks for JS code and it is simple to set up and use, the nock module was extremely powerful as it allows me to manipulate requests to servers and customize the response in order to keep the test results consistent. If I have used a real url to perform the testing, for example, google.ca, Google's server may go down and be temporarily unavailable, which will fail the tests, however, with the nock module, I will always have the customized response that I want for each test.Setting up the tools mentioned above is easy, simply follow the instructions here  to set up Jest, and run " npm install --save-dev n...

Revisiting the Artistify Project

Image
During the Weeks of Release 0.2, I have worked on a project called Artistify, which is a Music application which utilizes a npm package to work with the YouTube API and allow users to produce a music queue. This week, I revisited the project repository. And found out that there were huge differences than it was few weeks ago, the project that I forked was already behind by around 100 commits, the Project name has been changed, the application front-end has gone through a lot of updates as well. I found this project very interesting ever since I started on working on it, since I usually like to listen to music when doing work, studying or playing games, I have actually used the application a couple times. The user experience was decent except for a few minor issues, but there was this one bug that I found very annoying which is when clicking the "remove song from queue" button that is included in the row that displays the song, the song is removed, but it also triggers the pla...

Working on the Telescope Project

Image
Two weeks ago, I've had my first chance of working with the Telescope project and utilized it's back-end API to work with my DLCheck Project. In the past few days, I got more involved, played around and worked with Telescope's front-end portion. One of the issues that I found in the project repository got an idea from the Node.js webpage and requested for a React Component to display the contributors' information to thank them for their effort in developing/maintaining the Telescope project. In the beginning, I was a bit lost by reading the existing code, but luckily, the telescope project was developed using the React JS library and utilizes Material-UI framework, I have worked with a project which was also developed using the same tools during my Release 0.2 assignment, therefore, I was able to understand pieces of codes fairly quick. The new Card Component was overall not that hard to implement but it still took me a quite bit of time, I was given a custom React Hook...

Using Code Formatter and Linter

This week I was introduced to automated code formatting and linter to check for mistakes in code, I have heard of those tools before but never used them until this week. Those tools assisted me to maintain the code structure and readability, using those tools resulted in huge differences between the original project and "fixed project". To install Prettier, I followed their official installation instructions, which can be found here , and I did the same to install ESLint . There was a small problem that I ran into when I ran "eslint file.js" command, the system warmed that "eslint" is not a valid command, this was eventually solved by installing the eslint-cli, which was not mentioned in the official instructions. After I finished the set ups and configurated the tools, I ran the "script npx prettier --write ." to automate the formatting, this changed hundreds of lines in my .js files, I wasn't really surprised by this because I have always t...

Working with Telescope API

Image
This week I have started working with the Seneca Telescope project, the setups required for this project was way more complex than I thought, it took me around two hours just to install and figure out how to get the project running, I ran into a problem while installing Elasticsearch where it wouldn't run on my machine, it was eventually resolved by trying a different version. After all the required technologies were installed, I spent a few minutes checking out how the project works, including running the front end and testing the blog post API. My task for this week is to use the DLCheck command line tool to work with the Telescope API to check the status code of the 10 most recent blog posts. The method I chose is to add another command line argument (--telescope or --t), and this will make a get request by utilizing the "request" npm module, the body then will be parsed into a JSON object array, then each of the JSON objects' id will be used. I have used a npm mod...