NgenTest -Test Case Generation

Vignesh Ravichandran
1 min readNov 26, 2020

Framework Used:
Jasmine and Karma with Angular

Purpose Used:
To generate Unit test cases

Methodology to be followed:
1.use the command to install ngentest to your project

npm install ngentest

2.then to generate a spec file for the code written in your component.ts

ngentest app.component.ts -s

the main point to note is that, the last command has to be done inside of your component’s main folder in your terminal and not under your project’s main folder

3.Incase if you already have a spec file then we can use the same command without -s suffix,

ngentest app.component.ts

then the test contents will be generated in the terminal, which we can later paste them to our file

Common Errors:

invalid ts file
The error that most of us might encounter is with the path setting. So please ensure that the command is entered at the correct file path

Npm Page:
https://www.npmjs.com/package/ngentest

--

--