Celtrix icon indicating copy to clipboard operation
Celtrix copied to clipboard

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

Open amanvatss opened this issue 1 year ago • 3 comments

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!

amanvatss avatar Oct 03 '25 18:10 amanvatss

🤔 Potentially Related Issue Found 🤔

This issue seems related to:

  • Issue #103: "feat: Add Docker support for generated projects" (83.4% similar) Link: https://github.com/celtrix-os/Celtrix/issues/103

This issue is not identical but may be related. A maintainer will review to determine if they should be linked or if this is indeed a separate issue.

This comment was generated automatically by Seroski-DupBot 🤖

Check out the developer: Portfolio

github-actions[bot] avatar Oct 03 '25 18:10 github-actions[bot]

@amanvatss , Assigned !

JoeCelaster avatar Oct 03 '25 19:10 JoeCelaster

Hi @JoeCelaster I think we should increase the scope. Testing suite for each stack would be different, so let's create an issue on adding test suite capability for each stack user selects. And we can start with MERN for now? Maybe as a sub-issue. It is supported I believe?

suu-b avatar Mar 28 '26 07:03 suu-b