ng-test-barrel
v1.0.6
Published
Package for generating bare-bone structure for unit test spec files!
Downloads
11
Maintainers
Readme
Angular Jest Spec Generator
This plugin is designed to simplify the process of creating barebone structure for Angular spec files by analyzing the imports and constructor definitions of Angular components. This plugin is capable of generating spec files in the given folder recursively. It currently supports Jest as the testing framework.
Installation
To install the Angular Test Generator plugin, follow these steps:
Open your Angular project in the terminal.
Run the following command to install the plugin globally:
npm install -g ng-test-barrel
Usage
Once you have installed the plugin, you can use it to generate spec files for your Angular entities. Follow the steps below:
Open a terminal in your Angular project's root directory.
Run the following command to execute the Angular Test Generator:
ng-test-barrel
Follow the prompts and provide the inputs
The plugin will analyze your Angular component,services' imports and constructor definitions and generate corresponding spec files in the appropriate directories if they doesnot exist already
You can review the generated skeleton spec files to ensure they meet your testing requirements. Feel free to modify them as needed.
Prompt property description
|Property Name| Description| Example
|--|----------------------|--|
| 1.folder
| path to folder inside which the search has to take place and spec files should be created | ./src/app/components
|
| 2.file-pattern
| comma separated patterns for files for which the spec files need to be created| service.ts,app.directive.ts
|
| 3.exclusion-path
| optional field- the folders/files that need to be excluded from the search | ./src/app/components/test
|
Example
License
This project is licensed under the MIT License. See LICENSE for more information.