Skip to content

This project is set up with a powerful code generation tool called Plop. With Plop, you can easily create new components along with their corresponding test files automatically. This ensures consistency across your codebase and saves you time.

License

Notifications You must be signed in to change notification settings

HASSANFARYAD/AutoCreateTestCases-React

Repository files navigation

React Project with Automated Component and Test Generation

Welcome to the React project repository! This project is set up with a powerful code generation tool called Plop. With Plop, you can easily create new components along with their corresponding test files automatically. This ensures consistency across your codebase and saves you time.

Features

  • Automated Component Creation: Quickly scaffold new React components.
  • Automatic Test File Generation: Each new component comes with a pre-configured test file.
  • Consistency and Efficiency: Standardized component and test structure to maintain code quality and speed up development.

Getting Started

  • Follow these instructions to get the project up and running on your local machine.

Prerequisites

  • Make sure you have Node.js and npm installed. You can download them from nodejs.org.

Installation

  • Clone the repository:

Install the dependencies:

npm install

Generate a New Component and Test File:

This project uses Plop to streamline the creation of new components and their corresponding test files.

To generate a new component, run:

npx plop component

You will be prompted to enter the name of the new component. Plop will then create the following files in the src/components directory:

ComponentName/ComponentName.js: The new React component. ComponentName/ComponentName.test.js: The Jest test file for the new component. Running Tests:

After generating a new component and its test file, you can run the tests using:

npm test

Project Structure

  • Here's an overview of the project structure:

my-app/ ├── plop-templates/ │ ├── Component.js.hbs │ └── Component.test.js.hbs ├── src/ │ ├── components/ │ │ └── ExampleComponent/ │ │ ├── ExampleComponent.js │ │ └── ExampleComponent.test.js ├── plopfile.js ├── package.json └── ...

Contributing

We welcome contributions! Please fork the repository and submit a pull request for any changes you'd like to make.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any questions or suggestions, feel free to open an issue or contact us at [email protected].

About

This project is set up with a powerful code generation tool called Plop. With Plop, you can easily create new components along with their corresponding test files automatically. This ensures consistency across your codebase and saves you time.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages