{"_id":"@automobilmart/autombilmart-backend-test-setup","name":"@automobilmart/autombilmart-backend-test-setup","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@automobilmart/autombilmart-backend-test-setup","version":"1.0.0","description":"Complete backend test database setup with MongoDB and deterministic seeding","scripts":{"build":"tsc","seed:shard0":"npx db-seeder --shard-index 0 --shard-total 4 --db-uri mongodb://localhost:27017/automobil-mart-test-shard-0","seed:shard1":"npx db-seeder --shard-index 1 --shard-total 4 --db-uri mongodb://localhost:27017/automobil-mart-test-shard-1","seed:shard2":"npx db-seeder --shard-index 2 --shard-total 4 --db-uri mongodb://localhost:27017/automobil-mart-test-shard-2","seed:shard3":"npx db-seeder --shard-index 3 --shard-total 4 --db-uri mongodb://localhost:27017/automobil-mart-test-shard-3"},"bin":{"db-seeder":"dist/index.js"},"devDependencies":{"@faker-js/faker":"^8.3.1","@types/node":"^20.10.6","dotenv":"^16.3.1","mongodb-memory-server":"^9.1.5","mongoose":"^8.0.3","nodemon":"^3.0.2","ts-node":"^10.9.2","typescript":"^5.3.3"},"engines":{"node":">=18.0.0"},"dependencies":{"sparse-bitfield":"^3.0.3"},"_id":"@automobilmart/autombilmart-backend-test-setup@1.0.0","gitHead":"b3c2395d6e4f8c26d642d06cb991b5858f6afcbd","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-XUw32XTX65Lb7nd2w4CJc7MktKN4dGS4HlvsPnt1p6qVE+mhZN/ryemmtpK6Hmkl1gIp5czAs7qMcTLghTaEAA==","shasum":"5223db909a0ec551b1971e5ae1737615c0fac585","tarball":"https://registry.npmjs.org/@automobilmart/autombilmart-backend-test-setup/-/autombilmart-backend-test-setup-1.0.0.tgz","fileCount":73,"unpackedSize":423578,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCYXpizZCyA5p7iyv5G5uGNpgH/6p7gIkLg/hikIVucPwIgeJCGV1V0kS+8hXkT5sGUuXEeransm46pGVCGPkNS3lU="}]},"_npmUser":{"name":"simplenodeguy","email":"ekoemmanueljavl@gmail.com"},"directories":{},"maintainers":[{"name":"simplenodeguy","email":"ekoemmanueljavl@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/autombilmart-backend-test-setup_1.0.0_1771347758299_0.20103708651016006"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-17T17:02:38.212Z","1.0.0":"2026-02-17T17:02:38.463Z","modified":"2026-02-17T17:02:38.678Z"},"maintainers":[{"name":"simplenodeguy","email":"ekoemmanueljavl@gmail.com"}],"description":"Complete backend test database setup with MongoDB and deterministic seeding","readme":"# Backend Test Database Setup - Complete Guide\n\n## 🎯 Overview\n\nThis setup provides a **complete, production-ready backend testing infrastructure** that:\n- ✅ Spins up fresh MongoDB for each CI/CD run\n- ✅ Seeds deterministic test data (cars, users, orders)\n- ✅ Completely isolated from production\n- ✅ Sharding-safe and parallel-test compatible\n- ✅ Works with Jenkins, GitHub Actions, local dev\n- ✅ Automatic cleanup after tests\n\n---\n\n## 📁 Project Structure\n\n```\nbackend-test-setup/\n├── config/\n│   ├── database.config.ts          # DB configuration\n│   └── test.env                    # Test environment variables\n├── db/\n│   ├── connection.ts               # MongoDB connection manager\n│   ├── seeders/\n│   │   ├── index.ts               # Main seeder orchestrator\n│   │   ├── users.seeder.ts        # User data seeding\n│   │   ├── cars.seeder.ts         # Car inventory seeding\n│   │   ├── orders.seeder.ts       # Order data seeding\n│   │   └── payments.seeder.ts     # Payment records seeding\n│   ├── factories/\n│   │   ├── user.factory.ts        # User data factory\n│   │   ├── car.factory.ts         # Car data factory\n│   │   └── order.factory.ts       # Order data factory\n│   └── models/\n│       ├── User.model.ts          # Mongoose User schema\n│       ├── Car.model.ts           # Mongoose Car schema\n│       └── Order.model.ts         # Mongoose Order schema\n├── scripts/\n│   ├── setup-test-db.ts           # Setup script\n│   ├── teardown-test-db.ts        # Cleanup script\n│   └── seed-db.ts                 # Seeding script\n├── docker/\n│   └── docker-compose.test.yml    # MongoDB test container\n├── ci/\n│   ├── jenkins/\n│   │   └── Jenkinsfile.test       # Jenkins pipeline\n│   └── github/\n│       └── workflows/\n│           └── test.yml           # GitHub Actions workflow\n└── package.json\n```\n\n---\n\n## 🚀 Quick Start\n\n### 1. Installation\n\n```bash\nnpm install --save-dev \\\n  mongodb-memory-server \\\n  @faker-js/faker \\\n  mongoose \\\n  dotenv\n```\n\n### 2. Setup Test Database\n\n```bash\n# Local development\nnpm run test:db:setup\n\n# Run tests\nnpm test\n\n# Cleanup\nnpm run test:db:teardown\n```\n\n### 3. CI/CD (Automatic)\n\n```bash\n# Jenkins / GitHub Actions will:\n# 1. Spin up MongoDB\n# 2. Seed test data\n# 3. Run tests\n# 4. Teardown everything\n```\n\n---\n\n## 📄 Complete Implementation\n\nBelow are all the files you need, ready to copy-paste!\n\n---\n\n## Files to Create\n\nAll files are production-ready and follow TypeScript/Node.js best practices.\n","readmeFilename":"README.md","_rev":"1-6002ff9f47a14615a795d6434ba9841a"}