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
muslnode 18–226 runs
build_error
glibcnode 18–226 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();
Errors
Common errors & fixes
Error: Cannot find module 'mtools'
Python mtools package is not installed.
fixRun: 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.
fixUpgrade Node to version 8.9.1 or later.
Audit
Dependencies
mtoolsrequiredRequired for MongoDB testing utilities