Release 0.3 PR2

  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 Telescope. When I started this the first place I went was to the issues page on the Telescope repository. I saw there were some tests that needed to be written and were interested in taking on one of these issues. These were more complex than the test I wrote for the first part of 0.3 so  I saw it as a good opportunity to improve my skill. I asked in Slack for some advice on what to do and was given this idea from David:


This seemed like a good test to write (challenging but something I can figure out) so I made an issue for it and started working! When I first wrote the test everything looked fine but it kept on failing. At first, I thought that's good, if we pass an invalid date shouldn't the test fail? Turns out I didn't funny understand the syntax of Jest testing. David explained to me that when:
 expect(() => createPostWithDates('Thu, 45, Nov 2014', 'Thu, 35 Dec 2014')).toThrow()
fails jest is saying "this should throw but it didn't". So I went back to see why it won't throw. I tried many things: at first, I thought there might be something wrong with the enduseDate function, I kept rewriting the tests, but nothing was working. I went back to the issue and made a comment letting the maintainers know my troubles. Calvin took a look and also couldn't figure out why this kept failing. After some discussion, we asked David for some help. Turns out my understanding of this issue was wrong. The entire time I thought an invalid date is something like Jan 40 2015. Turns out the date object already checks that for us (I did not know that before!). For this reason, the ensureDate() function only needs to check if we are passing a date object or not. After learning this, I was able to complete the test! 

I then made a pull request and got my code merged!
This experience made me learn to always take some time, in the beginning, to really understand the issue and code surrounding it. Although at times one is excited to start and finish something we sometimes fail to realize that spending time, in the beginning, to understand the code will save us time while writing some new code. Before I end this blog I would like to thank Calvin and David for helping me with the road bumps I encountered with this issue. Looking back I am really happy this happened as this experience led me to learn something new about the Javascript Date object.   







 

Comments

Popular posts from this blog

OSD600 Release 0.4 Part 3

OSD 600 Lab 2