How to use the chance.floating function in chance

To help you get started, we’ve selected a few chance examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gobwas / dm.js / test / unit / dm.js View on Github external
it("should return promise, resolved with given value if it is not a string, array or an object", function(done) {
                RSVP
                    .all((list = [null, chance.natural(), chance.floating(), undefined, new Error]).map(function(value, index) {
                        return dm.parse(value);
                    }))
                    .then(function(results) {
                        results.forEach(function(result, index) {
                            var call;

                            expect(call = async.resolve.getCall(index)).to.exist();
                            expect(call.calledWithExactly(list[index])).to.be.true();
                            expect(result).equal(list[index]);
                        });
                    })
                    .then(done)
                    .catch(done);
            });

chance

Chance - Utility library to generate anything random

MIT
Latest version published 6 months ago

Package Health Score

76 / 100
Full package analysis