Registry / testing / test-utils

test-utils

JSON →
library0.1.0jsnpmunverified

A Node.js package providing MongoDB test utilities. It requires Node >= 8.9.1, Yarn >= 1.3.2, and mtools >= 1.3.2 (Python). The package has infrequent releases; the last stable version is 1.1.1. It integrates with Python-based mtools for MongoDB testing. Key differentiators include dependency on Python ecosystem and explicit version requirements.

npm install test-utils
INSTALL
IMPORT
SIG · TEST-UTILS
T
test-utils
testingjavascriptv0.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

defaultExport
import testUtils from 'test-utils'
const testUtils = require('test-utils')
Package likely uses default export; CommonJS require may work but ESM is recommended for modern Node.

Shows how to start a test MongoDB instance, perform operations, and stop it.

import testUtils from 'test-utils'; // Example: create a test MongoDB instance const mongo = await testUtils.startMongo(); console.log('MongoDB started on port', mongo.port); // Use the instance const db = await mongo.db('test'); await db.collection('test').insertOne({ key: 'value' }); const doc = await db.collection('test').findOne({ key: 'value' }); console.log(doc); // Stop await mongo.stop();
Debug
Known issues
gotchaRequires Python packages (mtools, pymongo, etc.) to be installed via pip.
fix
Run: pip install mtools pymongo numpy psutil python-dateutil
affects: >=0.0.0
gotchaMinimum Node version 8.9.1; not compatible with older Node versions.
fix
Upgrade Node to 8.9.1 or later.
affects: <8.9.1
gotchaMinimum Yarn version 1.3.2 required; using older Yarn may cause issues.
fix
Install Yarn 1.3.2+.
affects: <1.3.2
Errors
Common errors & fixes
Error: Cannot find module 'mtools'
Python mtools package is not installed.
fix
Run: pip install mtools pymongo numpy psutil python-dateutil
Error: The engine "node" is incompatible with this module. Expected version ">= 8.9.1". Got "x.x.x"
Current Node version is below 8.9.1.
fix
Upgrade Node to version 8.9.1 or later.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
mtoolsrequiredRequired for MongoDB testing utilities
Agent activity
23 hits · last 30 days
node
20
Meta
1
OpenAI (training)
1
Resources
test-utils — npm install test-utils · libregistry