Generating unit test template for entity based on static information of entity file. Include generating:
- spy imports
- spy declaration
- spy initialization
- creating sut
- describes for public methods
Support:
- jest
- jasmine
npm i -g angular-unit-test-generator
OR
yarn global add angular-unit-test-generator
After installation, go to folder with entity, which you want to test.
For example, entity - flows.service.ts
Run command - aug flows.service.ts
As a result, file flows.service.spec.ts will be generated
Go to examples - link
Package can be configured by config in root of project - aug.json
- spyUtilsPath
- Description - ES6 import for providing SpyObj and createSpyObj utils
- Default value - angular-unit-test-generator/testing-utils/jest