Skip to content

feat: Add pre-configured testing environment with Jest and Testing Library #111

@amanvatss

Description

@amanvatss

The templates generated by Celtrix provide an excellent starting point for development. However, to be truly "production-ready," a project needs a testing framework. Currently, developers have to manually set up their entire testing environment, which can be time-consuming.

I propose adding a pre-configured testing environment to the templates, starting with the React-based stacks (like MERN). This would include:

  1. Install Dependencies: Automatically include jest, babel-jest, @testing-library/react, and @testing-library/jest-dom as development dependencies.
  2. Configuration: Add the necessary configuration files, such as jest.config.js and a Babel config (.babelrc) if needed for Jest to understand JSX.
  3. Example Test: Include a simple "smoke test" for a component (e.g., App.test.js) to prove that the testing setup is working correctly out-of-the-box.
  4. Add npm test script: Add a script to package.json so developers can run their tests with a simple npm test command.

Additional context

Integrating a testing framework would be a significant step forward for Celtrix, making the generated projects more robust and complete. This feature would save developers a lot of setup time and encourage best practices from the start.

I am excited to take on this feature for #Hacktoberfest. Please let me know if this is a valuable addition to the project!

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions