ng-test-barrel

1.0.6 • Public • Published

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
  1. Follow the prompts and provide the inputs

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

  3. 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.

Package Sidebar

Install

npm i ng-test-barrel

Weekly Downloads

8

Version

1.0.6

License

MIT

Unpacked Size

3.44 MB

Total Files

7

Last publish

Collaborators

  • asaralaya