Hacktoberfest 05 — Improving my Toolkit

Julia McGeoghan
3 min readOct 31, 2018

--

When working on one of my previous pull requests, I noticed that when I ran tests for the project some of them weren’t passing. They weren’t related to the work I was immediately doing and I felt there were too many of them to fix in that moment, so I thought they’d be a good thing to tackle for my final Hacktoberfest PR.

There were three, with the first being the most challenging. I spent some time digging into mock-fs, trying to figure out how to copy mocked files in a way that wouldn’t break the test. It turned out that simply updating the mock-fs dependency to its latest version fixed the error.

I remember the most difficult thing about it was that, at first, I didn’t know the file system was mocked; I was trying things against the existing file system, not understanding why nothing I expected was happening! When I figured it out it was frustrating, but just as well interesting. I never knew the nodejs file system itself could be mocked in such a way, and it was a really good thing to take note of for the future.

For the second broken test I needed to create a fix related to ffmpeg. This one made me the most nervous, initially, as it was something I was never before exposed to. However this one turned out to be straight forward; the test was simply checking for a local ffmpeg installation by checking for its version on the command line. My test failed because my version was different than the one checked for, so I changed the test to make it test for a more generic version number.

And for the final test I needed to fix an error related to pdf conversion. The size of the buffer being checked for wasn’t the same as my own making the test fail, even though my result was still technically valid. I made it so the test still passed with my result, and after that all tests ran smoothly.

For me, one of the greatest things about contributing to these projects are the technologies I’ve learned about along the way. Not only have I been learning about them as a potential utility, but in the process of fixing bugs I’ll often learn how they work beyond a surface level. This new knowledge may at times give me ideas for new projects, or better yet will increase my ‘toolkit’ of technologies I know when I decide to create a certain type of project or fix a given problem in the future.

--

--

Julia McGeoghan

Open source enthusiast. Wants to make cool things with code.