Memoirs of a Junior Developer: Testing is FUN. No, really.

Sammy-Jo Wymer
REWRITE TECH by diconium
4 min readOct 11, 2022

To be specific: E2E-testing

This article is intended for aspiring developers or newbies in the web development world.

Almost 1 year ago, I started my frontend developer journey. I followed the typical path of HTML, CSS, JavaScript, React, etc.

At this point, I’d never heard of the likes of Jest, Mocha or Cypress and I had no intention of doing so.

Maybe you haven’t heard of these yet either and also had no intention of doing so. But here I am, ready to ruin all your good intentions.

Six months after this wonderful enlightenment, I got my first job in tech, as a Junior Software Engineer at diconium and it was then that the true enlightenment began.

Photo by Nitin Arya: https://www.pexels.com/photo/photography-of-book-page-1029141/

Of course, starting a new role in a completely new field is overwhelming. Before this job, I (naively) felt pretty confident and secure about the knowledge and skills I had developed, particularly in the aforementioned programming languages.

I quickly realised that there were a million and one things I hadn't even heard of in the frontend development world, and I had A LOT of my own development to do as a developer.

And so this development began.

I focused predominantly on the popular frontend frameworks and on improving the languages I already had experience with, skimming over anything that wasn’t directly related to my role as a frontend developer.

Then I started in my first project.

*cue further enlightenment*

I’ll spare you all the details, but it was in this project that I realised I’d been narrow-minded in my approach to my development in my new role. I’d taken the frontend and developer labels too literally and forgot to consider software engineer as a whole package.

Photo by Kim Stiver: https://www.pexels.com/photo/person-s-holds-brown-gift-box-842876/

The project is multi-faceted and involves much more than frontend and developer skills. And so, 8 months into my journey, I finally came face-to-face with end-to-end testing.

Testing. Urgh, that horrible word.

End-to-end (E2E) tests.
Unit tests.
Integration tests.

… all of these terms that I’d heard passively but had actively avoided as they sounded really quite boring, and I honestly didn’t feel they were within the scope of my role as a frontend developer.

Hindsight is a wonderful thing though, and I can now say (3 months on) that E2E-testing is definitely not boring and is actually a really useful (and increasingly more important) tool for frontend developers.

This is mainly thanks to the fact that we use Cypress in our project. Cypress makes E2E-testing a joy to do.

If you’re already familiar with Cypress feel free to skip ahead. If not, here is Cypress in a nutshell:

🥜🐚

What is Cypress?

Cypress is basically is a testing tool that is built with developers in mind.

Cypress allows you to set up tests, write tests, run tests, and debug tests really easily with intuitive commands.

Read more here.

🥜🐚

Still not convinced?

The game-changer for me was finding out that Cypress tests are basically written in JavaScript. That’s right. The tests you write are more or less JavaScript functions.

A language that we all love ❤

simple Cypress test example

Above is a simple Cypress test example, and you can see just how similar it looks to a JavaScript function.

This article isn’t intended as a Cypress tutorial but to add some context to the above screenshot and to give you a better idea of what the test does:

describe = groups your test cases. For example, you could have one describe for each component you are testing.

Takes two arguments: the first is the name of the test group (here it is ‘spec.cy.js), and the second is a callback function.

it = used for an individual test case. For example, you may have a few it commands within one describe.

Takes two arguments: a string explaining what the test should do (here it is ‘should visit’), and a callback function which contains your actual test (here it is ‘cy.visit(‘/’)’).

As I said, this isn’t intended as a tutorial for Cypress but, if you’re interested, you can quickly get Cypress up and running and start writing your own tests by following the really user-friendly guide.

Photo by Hector Alicea: https://www.pexels.com/photo/green-cypress-trees-under-sunset-sky-10447021/

So, the moral of the story is not to be too rigid as a frontend developer. Yes, there are SO many things to learn in this field and it can get very overwhelming, very quickly.

But E2E-testing is an important and valuable part of frontend development, and is something we shouldn’t shy away from as developers.

Cypress makes E2E-testing easy to love and I promise you, if you start now, you’ll be comfortably writing your own tests within days if not hours (and enjoying it 😱)

Keep challenging yourself and remember, being uncomfortable means you are growing.

--

--