mern-qa-automation
v1.0.0
Published
The intelligent, automated testing surface generator & local dashboard runner for MERN and React applications.
Maintainers
Readme
MERN-QA
The intelligent, automated testing surface generator & local dashboard runner for MERN and React applications.
mern-qa is a developer-friendly CLI tool and interactive local dashboard that scans your MERN project, automatically maps frontend/backend code components, performs system preflight diagnostics, and generates complete test configurations and assertion boilerplates for Unit, Integration, E2E, Security, and Performance testing.
Key Features
- 🔍 Intelligent Directory Scanning: Auto-detects frontend (React/Vite) and backend (Express) folders even in nested, sibling, or monorepo workspace setups.
- 📂 AST Code Parsing: Traverses routes, middlewares, Mongoose models, and React components to build a map of what needs testing.
- 🛡️ Pre-test Diagnostics: Validates
.envvariables, port conflicts, and local MongoDB connection issues, providing clear guides to resolve errors. - ⚡ Automated Test Surface Generation: Injects configurations for Jest, Supertest, and Playwright with custom TypeScript/JavaScript configurations.
- 🎭 Dynamic Faker.js Mock Data: Generates test templates with randomized realistic payloads to prevent database duplicate key constraints.
- 💻 Local Web Dashboard (Hybrid Model): Start a clean local web GUI (
npx mern-qa ui) to trigger runs, visualize code coverage, and audit logs safely. - 🚀 Advanced Automation:
- Auto-generated GitHub Actions CI/CD workflows.
- Outgoing external API intercepts (Stripe/SendGrid mocking).
- Visual regression/layout testing snapshots.
- Multi-format report exports (PDF, HTML, JUnit XML).
- Parallel test execution optimization.
Installation
Add mern-qa as a development dependency in your root MERN workspace:
npm install --save-dev mern-qaQuick Start
1. Initialize & Scan
Scan your MERN project, review diagnostics, and generate the configuration and test files:
npx mern-qa init2. Launch Local Dashboard
To launch the interactive glassmorphic dashboard interface:
npx mern-qa uiOpen your browser at http://localhost:9000 to execute test suites and view live coverage reports.
3. Run Tests via CLI
Execute all configured test suites:
npx mern-qa runOr run a specific test suite:
npx mern-qa run --only unit
npx mern-qa run --only api
npx mern-qa run --only e2eConfiguration (mern-qa.json)
The initialization command creates a configuration file in your root folder:
{
"projectType": "MERN",
"isTypeScript": true,
"frontend": {
"path": "./client",
"framework": "vite-react",
"port": 3000
},
"backend": {
"path": "./server",
"framework": "express",
"entry": "./server/server.ts",
"port": 5000
}
}License
This project is licensed under the MIT License - see the LICENSE file for details.
