1.0.6 • Published 10 months ago

ng-test-barrel v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
10 months ago

Angular Jest Spec Generator

npm js node

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.

mit actions

Coverage Status


Installation

To install the Angular Test Generator plugin, follow these steps:

  1. Open your Angular project in the terminal.

  2. 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:

  1. Open a terminal in your Angular project's root directory.

  2. Run the following command to execute the Angular Test Generator:

    ng-test-barrel
3. Follow the prompts and provide the inputs
4. 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

5. 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
<img src="https://github.com/asaralaya/jest-template/blob/main/docs/example.png" width="800">

---
## License

This project is licensed under the MIT License. See LICENSE for more information.
1.0.6

10 months ago

1.0.5

10 months ago

1.0.4

10 months ago

1.0.3

10 months ago

1.0.2

10 months ago

1.0.1

10 months ago

1.0.0

10 months ago