DEV Community

suhhee1011
suhhee1011

Posted on

2

Creating test plan

This lab was about how to create a test plan for the static website generator. First I need to choose which testing framework that I am going to use. I chose jest framework because it seems easy in the professor's lectures. This is a testing framework for node.js. It helps us to test from units to end-to-end testing.
And below is the steps to implement a testing script to the program.
First, I download the jest framework using npm.

npm i jest
Enter fullscreen mode Exit fullscreen mode

Second, I added, "test": "jest" to the script in package.json file.

 "scripts": {
      "test": "jest"
   },
Enter fullscreen mode Exit fullscreen mode

After that, I created a test.js file for each of the javascript files that needed to test in the same folder of the javascript file. For example,

cli.js => cli.test.js
Enter fullscreen mode Exit fullscreen mode

Finally, I created a testing plan for the test plan.
First of all, I created a testing plan for all the possible user inputs. I was quite impressed while I am creating the test cases. This is because, previously, I tested manually all the features that I added to the program and all the edge cases. And I need to test again most of the features if I add a feature, just in case if the added feature can affect other existing functions.

After that, I created unit test cases for converting from the text and markdown file to HTML files. It was also impressive because to test the single function I need to debug with the IDE that I am using or I put the console.log to make sure it runs properly. But as these unit test cases that I create will test all the needed functions, I think it will save lots of my time.

As creating testing plan, save lots of my manual testing time. From now on, I think I am going to use this framework to test the features of the program that I will create.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay