alonroninalonroninCommunityยท5 Agent Skills Included

mockingoose

Mock Mongoose models in tests without a database

Mocks Mongoose model operations like find, save, update, and aggregate so tests run without a live MongoDB connection. Eliminates slow database setup, flaky test data, and manual stub wiring in Jest or Vitest suites. Supports query inspection, error simulation, cursor mocking, and one-line resets to keep test code short and reliable.
npx skills add alonronin/mockingoose --all -g -y
Available:

Tells your AI agent how the mocking library works internally, which commands to run for tests and builds, and which sub-skills to use for TypeScript, Vitest, Mongoose, and CI tasks.

All Skills in This Repository (5)

Pure Emerald Level Indicators

Frequently Asked Questions

FAQPage Schema
How 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โ†’