aboutsummaryrefslogtreecommitdiff
path: root/test/helpers.unit.js
diff options
context:
space:
mode:
Diffstat (limited to 'test/helpers.unit.js')
-rw-r--r--test/helpers.unit.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/test/helpers.unit.js b/test/helpers.unit.js
index 425167e2..fa2f4a90 100644
--- a/test/helpers.unit.js
+++ b/test/helpers.unit.js
@@ -21,6 +21,16 @@ describe("helpers.js", function () {
});
});
+ 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 () {
it("removes unwanted characters from URI string", function () {
assert.equal(faker.helpers.slugify("Aiden.HarÂȘann"), "Aiden.Harann");
@@ -43,14 +53,6 @@ describe("helpers.js", function () {
});
// Make sure we keep this function for backward-compatibility.
- describe("randomNumber()", function () {
- it("returns an integer", function () {
- var num = faker.helpers.randomNumber();
- assert.ok(typeof num === 'number');
- });
- });
-
- // Make sure we keep this function for backward-compatibility.
describe("randomize()", function () {
it("returns a random element from an array", function () {
var arr = ['a', 'b', 'c'];