allenhwkim / ngentest

Angular6+ Unit Test Generator For Components, Directive, Services, and Pipes
https://ngentest.github.io
MIT License
144 stars 60 forks source link

Framework Options not supported if we use the package directly in our code #72

Closed k3t4ngit closed 6 months ago

k3t4ngit commented 6 months ago

As you can see framework options is picked from options only in case of cli.js image

when we are directly importing the ngentest function and using it the cli does not get called I believe.

Resulting the test generated are always in jest and not in karma.

The proposed solution is to pick framework from options when we are directly importing the ngentest in our code.

I am working on a vscode extesnion using this which already being published at https://marketplace.visualstudio.com/items?itemName=KetanTiwari.ngen-utc-vscode

and here is the code - https://github.com/k3t4ngit/ngen-utc-vscode.

I will raise a pr for the same.

k3t4ngit commented 6 months ago

Resolved it by including UTIL like this and assigning framework to it manually

const Util = require('ngentest/lib/util.js');