testing-strategy

Automate Vitest unit test setup and execution for CampusOS modules with MongoDB-memory-server.

4|10|Updated Mar 31, 2026
One-click install
npx skills add https://github.com/NITRR-Official/CampusOS --skill testing-strategy-nitrr-official
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: testing-strategy
Source: https://github.com/NITRR-Official/CampusOS/tree/main/.agents/skills/testing-strategy
Command: npx skills add https://github.com/NITRR-Official/CampusOS --skill testing-strategy-nitrr-official

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires vitest, mongodb-memory-server, and includes scripts (resource) and references (resource) components.

What problem does it solve?

This Skill simplifies the process of setting up and running tests for CampusOS modules, ensuring robust functionality and code quality.

Core Features & Use Cases

  • Test Framework Integration: Supports Vitest for efficient testing of CampusOS modules.
  • Infrastructure Setup: Automates MongoDB in-memory server setup for test databases.
  • Service Testing: Offers patterns for testing service layer code.
  • Use Case: When developing a new feature in CampusOS, use this Skill to quickly create a test environment and start writing tests.

Quick Start

Initialize tests for the 'Vendor' module by running the command: pnpm -C apps/vendor test -- --run

Frequently Asked Questions about testing-strategy

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up Vitest with MongoDB for service layer testing?

To set up Vitest with MongoDB for service layer testing, you can automate the environment configuration using mongodb-memory-server to create an isolated in-memory test database within the CampusOS ecosystem.

What is the best way to test CampusOS modules without affecting my live database?

The best way to test CampusOS modules without affecting a live database is using an in-memory MongoDB server, which provides an ephemeral database instance that automatically spins up for test execution and discards data afterward.

Does Vitest work with MongoDB-memory-server for infrastructure setup?

Yes, Vitest works seamlessly with mongodb-memory-server for infrastructure setup, allowing you to automate test database initialization and execute unit tests efficiently during your software development workflow.

How do I run unit tests for a specific CampusOS module from the command line?

To run unit tests for a specific CampusOS module, execute the command `pnpm -C apps/[module-name] test -- --run`, which triggers Vitest to execute the test suite for that directory.

How can I improve test coverage for service layer code in my development workflow?

You can improve test coverage for service layer code by integrating Vitest, which provides efficient testing patterns for infrastructure and service modules to ensure robust functionality and higher code quality.