test-mixer is a JavaScript/TypeScript utility library designed to assist with testing by programmatically generating variations of JavaScript option objects. Its primary function is to create all possible combinations of boolean properties within a given default options object, which is highly useful for comprehensive test coverage without manually listing every permutation. The current stable version is 4.2.3. The library allows users to "pin" specific option values, effectively reducing the number of combinations generated by fixing certain parameters while iterating through others. Unlike some other testing utilities, test-mixer focuses specifically on combinatorial generation of option objects, making it a specialized tool for ensuring robust test suites, particularly for functions that accept configuration objects with many boolean flags. It is distributed as a pure ESM package and requires Node.js >=14.18.0.
npm install test-mixerVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to use the 'mixer' function to generate all boolean combinations of an options object and how to 'pin' specific values to reduce permutations, which is useful for targeted testing.
Migrate your project to use ES module syntax (e.g., `import { mixer } from 'test-mixer';`). If unable to migrate, install an older version like `test-mixer@2.1.0`.Ensure that the properties you intend to vary combinatorially are booleans. For non-boolean variations, manual iteration or other specialized libraries might be required.
Update your Node.js environment to version 14.18.0 or higher. For projects constrained to older Node.js versions, consider using `test-mixer@2.1.0`.
Change your import statement from `const { mixer } = require('test-mixer');` to `import { mixer } from 'test-mixer';` and ensure your project is configured for ESM (e.g., `"type": "module"` in `package.json`).Ensure you are using a named import: `import { mixer } from 'test-mixer';`. If using TypeScript, confirm your `tsconfig.json` compiler options (e.g., `"module": "esnext"`, `"esModuleInterop": true`) are correctly configured.No dependency data recorded yet.