Day 114 of #365DaysOfCode - Exploring Testing Frameworks

Day 114 of #365DaysOfCode - Exploring Testing Frameworks

Hey everyone, it's Day 114 of #365DaysOfCode & Day 14 of #100DaysOfPython! Just a quick update..Today was all about manually testing my project. I'm happy to report that so far, everything seems to be running smoothly.

Then, I thought it was time to add a little flair to the error messages for my OAuth popup window. Now, they're not only easier on the eyes, but they're also easier to understand. Another thing I worked on today was allowing users to update their profile info.

But, of course, no day would be complete without learning something new. I spent some time researching different types of testing: unit, integration, and end-to-end testing. It was pretty fascinating stuff.

I was also surprised to discover just how many testing frameworks are out there: Jestjs (developed by Meta), React Testing Library, Supertest, Cypress, Mocha, Chai.. and those are just a few.

So, in short:

Unit testing is the process of testing individual parts of your code. This could be individual functions or components. Jest is often used alongside a testing library like Enzyme or React Testing Library for React components.

Sort of one level above that is integration testing, which is when individual units are combined and tested as a group. This is to check if they function together correctly. Jest, Supertest and React Testing Library (for the frontend) can be used for that.

One level above that is end-to-end (e2e) testing. It simulates real user scenarios, essentially testing how all the parts work together. It's used to test whether the flow of an application is performing as designed from start to finish. Cypress and Puppeteer are common e2e testing frameworks for web applications.

That said, I'm not planning to go overboard with this. I've been testing my code thoroughly as I've been building, so I don't feel the need to use every testing tool under the sun.

Python:

I continued with my Python course today, focusing on building small, basic projects. While these may not be impressive yet, I'm thoroughly enjoying Python. However, coming from JavaScript, Python's use of indentation is something I still need to get used to.

All in all, today was a day of testing, tweaking, and learning. I'm looking forward to seeing what tomorrow brings. Until then, happy coding!