function valueEquals(test, expected) {
    return function (err, x) {
        // Must only run one test so that users can correctly
        // compute test.expect.
        if (err) {
            test.equal(err, null, 'Expected a value to be emitted.');
        }
        else {
            test.deepEqual(x, expected, 'Incorrect value emitted.');
        }
    };
}
Useful function to use in tests.