Comparing version 2.1.3 to 2.1.4
@@ -42,3 +42,3 @@ var faker = require('../index'); | ||
o = o || ["a", "b", "c"]; | ||
for (var j, x, i = o.length; i; j = faker.random.number(i), x = o[--i], o[i] = o[j], o[j] = x); | ||
for (var j, x, i = o.length-1; i; j = faker.random.number(i), x = o[--i], o[i] = o[j], o[j] = x); | ||
return o; | ||
@@ -45,0 +45,0 @@ }; |
{ | ||
"name": "faker", | ||
"description": "Generate massive amounts of fake contextual data", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"contributors": [ | ||
@@ -33,2 +33,2 @@ "Marak Squires <marak.squires@gmail.com>", | ||
"main": "index.js" | ||
} | ||
} |
@@ -24,2 +24,12 @@ if (typeof module !== 'undefined') { | ||
describe("shuffle()", function () { | ||
it("the output is the same length as the input", function () { | ||
sinon.spy(faker.random, 'number'); | ||
var shuffled = faker.helpers.shuffle(["a", "b"]); | ||
assert.ok(shuffled.length === 2); | ||
assert.ok(faker.random.number.calledWith(1)); | ||
faker.random.number.restore(); | ||
}); | ||
}); | ||
describe("slugify()", function () { | ||
@@ -26,0 +36,0 @@ it("removes unwanted characters from URI string", function () { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3771877
92
146014