Skip to main content

CRUD Testing Command

The crud-testing command generates test files for CRUD (Create, Read, Update, Delete) operations in your zopio project. This helps ensure your API endpoints and data handling functions work correctly.

Usage

Options

Examples

Generate Jest tests for a User model

Generate Mocha tests for a Product model

Generated Files

When you run the crud-testing command, the following test files will be generated:
  1. API Tests: Tests for API endpoints
  2. Service Tests: Tests for service functions
  3. Repository Tests: Tests for database operations
  4. Model Tests: Tests for model validation
  5. Test Fixtures: Sample data for testing

Example Test Structure

Example Jest Test

  • crud - Generate basic CRUD operations
  • crud-unified - Generate a complete CRUD setup