0

There is an npm package named SCURI which can be utilized to write unit test cases for .ts files automatically to cover more than 70% coverage .

Just need to install this package and once done, create autoSpy.ts file to define how to mock/create stubs for dependencies. enter image description here

Azure-Techno
  • 106
  • 1
  • 4

2 Answers2

0

I think the SCURI pluggin only will generate spec for you and help you update it when dependencies are added or removed!

Shabeer M
  • 160
  • 3
  • 9
  • correct for all public methods only, but still a good help for beginner – Azure-Techno May 25 '21 at 09:33
  • Also you would only l;eft with your assert statements and logic in between, mocking ur dependencies, and stubs for all functions in your file, it will do for you. – Azure-Techno May 25 '21 at 09:38
0

As it stated in the docs, it

Automates unit test boilerplate for Angular

so, reduces the no-brainers, i.e spec file creation, imports, constructor instantiations, method invocations, basic AAA pattern, some mocking etc.

All the (advanced) logical design and checks you better do yourself.

ekostadinov
  • 6,880
  • 3
  • 29
  • 47