One-wise combinatorial testing generator
npm install one-wise> One-wise combinatorial testing generator



A 1-wise (a.k.a. 1-way) testing generator guarantees that at least one value of each group appears in the generated tests. The produced array has exactly the length of the largest input array.
This is a fast and simple implementation of a 1-wise testing generator. No external dependencies. Uses semantic versioning.
``bash`
npm install one-wise
`javascript`
oneWise( {
"foo": [ "x", "y" ],
"bar": [ "a", "b", "c", "d" ],
"baz": [ "f", "g" ]
} )`
will returnjson`
[
{ "foo": "x", "bar": "a", "baz": "f" },
{ "foo": "y", "bar": "b", "baz": "g" },
{ "foo": "x", "bar": "c", "baz": "f" },
{ "foo": "y", "bar": "d", "baz": "g" }
]foo
Note: the values of and bar in the last two lines are picked randomly.
It uses JavaScript's Math.random(), but a predictive pseudo-random generator function (e.g., seedrandom) can be passed as a second argument. Such function must work like Math.random() and return a number >= 0 and < 1.`javascript`
oneWise( / your object /, myPseudoRandomNumberGenerator );
`html`
Option 2: Using unpkg and ESM:
`html`
`javascript`
const oneWise = require('one-wise');
`javascript`
import oneWise from 'one-wise';
- obj {object} - The given object.prngFunc
- {function} - Pseudo-random number generator function used to pick array elements to repeat. Defaults to Math.random`.
- shuffle-obj-arrays - Shuffles the arrays of the given object. A custom PRNG can be used.
- seedrandom - Predictive PRNG