Skip to content

Mockingoose v3: TypeScript rewrite, Mongoose 9, Vitest#108

Merged
alonronin merged 11 commits intomasterfrom
latest
Feb 9, 2026
Merged

Mockingoose v3: TypeScript rewrite, Mongoose 9, Vitest#108
alonronin merged 11 commits intomasterfrom
latest

Conversation

@alonronin
Copy link
Owner

Summary

 Major rewrite of mockingoose for modern Mongoose and TypeScript ecosystems.

 - **TypeScript rewrite** — Full rewrite from JavaScript to TypeScript with dual ESM/CJS output (`tsdown`), proper `exports` map,
 and generated `.d.ts` files
 - **Mongoose 9 support** — Peer dependency bumped to `^9.1.6`; removed deprecated ops (`count`, `update`, `remove`,
 `findOneAndRemove`); all tests use async/await
 - **New operations** — Added `replaceOne`, `bulkWrite`, `bulkSave`, and `cursor` support
 - **Jest → Vitest** — Test runner migrated to Vitest with `globals: true`; runtime auto-detects Jest or Vitest for mock function
 creation
 - **CI modernized** — CircleCI → GitHub Actions (Node 20 + 22); added release-please for automated npm publishing
 - **Node ≥20** — Dropped Node 18 (EOL April 2025); required by Vitest 4 / Vite 7

 ## Breaking Changes
 - Minimum Node.js version: **20** (was 6.4)
 - Minimum Mongoose version: **9.x** (was 4.9)
 - Removed operations: `count()`, `update()`, `remove()`, `findOneAndRemove()`
 - Build output moved from `lib/` to `dist/` (new `exports` map — transparent to consumers)

 ## Test plan
 - [x] `bun run test` — 95 tests passing
 - [ ] `bun run build` — dual ESM/CJS output
 - [ ] `bun run typecheck` — no type errors
 - [ ] CI passes on Node 20 + 22

@alonronin alonronin merged commit be26465 into master Feb 9, 2026
6 of 7 checks passed
@alonronin alonronin deleted the latest branch February 9, 2026 18:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant