How to automate test case generation (complete & running test case not just boilerplate) of an angular app?

1.4k Views Asked by At

I am a lazy programmer. I want to automate test case generation of my large angularjs app. Currently, I am using jasmine and karma.

What I want is, to extract the module, components and methods dynamically and create a test case which should pass.

Basically, I want to add it to 'watch' so that as I am coding, the test cases get generated and get passed/failed based on the status the code and supplied mock data.

Please help.

1

There are 1 best solutions below

0
Durgesh Rathod On

I found this thing and it does a lot of good job:

npm i ai-test-gen-angular
export OPENAI_API_KEY=somekey
node ./node_modules/ai-test-gen-angular/index.js "relative/path/to/service/or/somecomponent.component.ts" "relative/path/to/tsconfig.json" 

Answer was shared here