mocha-docker-postgres

JSON →
library 1.0.1 ·javascript
verified Jun 5, 2026

Mocha test helper that automatically manages a Docker-based PostgreSQL container for integration tests. Version 1.0.1 is the latest stable release. It patches Mocha's Context prototype to provide `this.dockerPostgres()` and `this.conString`. The container is reused across tests (only started once per run), and each call creates a fresh database, enabling fast, isolated test databases without manual setup or teardown. Lighter than full testcontainers solutions; designed specifically for Mocha.