npm.io
1.0.0 • Published 11 years ago

chance-multiseed

Licence
MIT
Version
1.0.0
Deps
1
Vulns
0
Weekly
0

chance-multiseed

A simple wrapper around chance for testing. Allows multiple seeds, strings or numbers. I use this in my tests like this:

var cm = require("chance-multiseed");

var masterKey = 12345,
    random;

beforeEach(function () {
    random = cm(masterKey, this.currentTest.title);
});

it("always returns 4", function () {
    var result = myFunction(random.string());
    assert.equal(result, 4);
});