feat: Add pre-configured testing environment with Jest and Testing Library
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:
- Install Dependencies: Automatically include
jest,babel-jest,@testing-library/react, and@testing-library/jest-domas development dependencies. - Configuration: Add the necessary configuration files, such as
jest.config.jsand a Babel config (.babelrc) if needed for Jest to understand JSX. - 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. - Add
npm testscript: Add a script topackage.jsonso developers can run their tests with a simplenpm testcommand.
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!
🤔 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
@amanvatss , Assigned !
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?