DEV Community

P-DR0ZD
P-DR0ZD

Posted on • Edited on

Using what i learned this week about tests, to help with another Open Source Project

This week I wrote a blog post about how I added tests to my Static site generator. this was the first time I was working with tests and I was using python. This week however I was working with a repo that I worked with during Hacktober fest.

cuttle

This repo was where I made my last Hacktober fest contribution and found a community that was very welcoming and helpful. I decided to work with them again because I enjoyed my experience last time.

What I did

Issue #163

This issue was about making it so the season leaderboards didn't show seasons that have yet to happen so they can add the future seasons all at once rather than adding them after the season is over.

Pull Request

Initially, I was fixing the find query where it searches all of the seasons so I added a where clause and a less than sign so it would filter out future seasons. This worked however it broke the tests for the leader boards, and they asked me to add a test to show that future leader boards aren't being shown.

To fix this I needed to learn about how the tests were conducted. The testing framework they were using was cypress a javascript testing framework. So first I edited the file with the season stats and the start date. After that, I figured out that I needed to change my less than to less than or equal to because it didn't include the first date. After fixing that I added my test where it tried to select the season that will always be a year in the future but it will never be available.

What did I learn

I got to have more practice with tests and got to try and use them on another language.

Top comments (0)