Knex Mock Client

JSON →
library 3.0.2 ·javascript
verified May 27, 2026

knex-mock-client is a testing utility designed to provide a comprehensive mock client for Knex.js, enabling developers to write isolated unit tests for database interactions without needing an actual database connection. The current stable version is 3.0.2. The library maintains an active release cadence, frequently publishing patch and minor versions to address bug fixes, improve type safety, and add new features like support for transaction isolation levels. Its key differentiators include flexible query matching (string, regex, or custom function), explicit control over response data and errors for different query types (select, insert, update, delete, any), and the ability to track executed queries for assertions. It's built to integrate seamlessly into testing frameworks like Jest by allowing the Knex client to be mocked with `MockClient`.

total hits 17
actors 7 distinct systems
last hit 1d ago human
MetaBot
4
GPTBot
2
Script
1
Search engines
2
Humans
2

top countries 🇺🇸 United States · 🇩🇪 Germany · 🇨🇦 Canada · 🇸🇬 Singapore · 🇫🇷 France