mockingoose
Mock Mongoose models in tests without a database
All Skills in This Repository (5)
Pure Emerald Level Indicatorstypescript-docs
Generate TypeScript API documentation with TypeDoc and ESLint validation.
vitest
Run unit tests for JavaScript and TypeScript projects with Vite.
typescript-advanced-types
Explain TypeScript generics with code examples and advanced type patterns.
github-actions-templates
Generate GitHub Actions workflows for testing, building, and deploying applications.
mongoose-mongodb
Facilitates MongoDB interactions in Node.js with Mongoose for schema definition and CRUD operations.
Frequently Asked Questions
FAQPage SchemaHow to install mockingoose?โผ
Run `npx skills add alonronin/mockingoose --all -g -y` in your terminal to install all skills in this suite globally.
How to test Mongoose models without a database?โผ
Use mockingoose to intercept operations like find, save, and aggregate, returning fixed data so tests never touch a real MongoDB server.
Does mockingoose work with Jest and Vitest?โผ
Yes. It automatically detects Jest or Vitest at runtime and creates the right mock functions for either framework.
Can I simulate database errors in tests?โผ
Yes. Pass an Error object to toReturn and the mocked operation will reject, letting you verify error handling paths.
What Mongoose operations can be mocked?โผ
All common operations are covered, including find, findOne, save, updateOne, deleteMany, aggregate, insertMany, bulkWrite, and query cursors.
Related Repositories in Software Engineering
View All in Software Engineeringโopenclaw
Run a personal AI assistant across your devices and chat apps
superpowers
Gives coding agents a disciplined workflow from idea to merged code
react
AI agent skills for building, testing, and porting React core