Release 0.3 PR1

 For release 3 we have to make 2 PR's. The first one must be for the Telesope project and the second one must be for an external project. These PR's must "build up" from the PR's we did for release 0.2. This blog post will highlight working on the PR for an external project. David suggests to "consider working on a repository/project you've already worked on in the past and have set up on your local machine". I took that advice when I started searching. Back in October, I worked on this repository, a collection of different kinds of algorithms written in different programming languages. In October I made a PR to add the Cocktail sort algorithm in C++. At the time this was good since I did not do much work with algorithms before. However, there was a new issue for the project that was perfect for release 0.3. This issue wanted people to add unit tests for an algorithm currently present in the repository. I have never written a unit test before and did not know much about what they are or how to write one so I really excited to work on this issue. After I forked and cloned the code I started my research. I first looked into the current unit test folders to get an idea of what needed to be done. I searched in the JavaScript/UnitTest folder. The last time I worked on this repository I did something in C++, so I wanted to do a different language.  I was aware of jest: a pretty popular library for writing tests in JavaScript but I didn't know much about it. I also realized the current unit test in the  JavaScript folder was written in jest. So I decided to do some research on how to write a unit test using Jest. The two main reasons I did this were: There already was a unit test written with jest and I wanted to follow their coding style, and I know Jest is used in Telescope so this was a good time to prepare myself for a possible Telescope issue.  I first read this article to get familiar with jest and how to use it. After that, I started writing a test for the insertion_sort algorithm in JavaScript. For the most part, writing the test went well, however, there were some minor roadblocks I encountered. When testing it kept failing for 2 reasons: 

1. Although I imported the file with the algorithm it kept saying it could not find the function. Turns out I put the wrong path when importing the file.

2. At first I did describe() instead of test(). This made the code crash since describe() has different parameters then test().

After I fixed those errors I was able to get it working!

In the end, I am really happy with this PR since I learned a new skill. The semester is still not over and we still have a couple more weeks. I am really excited about this as I am sure my knowledge of Open Source will continue to expand!   






Comments

Popular posts from this blog

OSD600 Release 0.4 Part 3

OSD600 Lab 5

Release 0.3 PR2