Skip to content

Commit

Permalink
Adds unit test for faker.lorem.word without a length param.
Browse files Browse the repository at this point in the history
  • Loading branch information
jreina committed Oct 2, 2017
1 parent f490bac commit 0bc3b03
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion test/lorem.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ describe("lorem.js", function () {
faker.helpers.shuffle.restore();
});

context("when 'num' param passed in", function () {
context("when no 'length' param passed in", function () {
it("returns a word with a random length", function () {
var str = faker.lorem.word();
assert.ok(typeof str === 'string');
});
});

context("when 'length' param passed in", function () {
it("returns a word with the requested length", function () {
var str = faker.lorem.word(5);
assert.ok(typeof str === 'string');
Expand Down

0 comments on commit 0bc3b03

Please sign in to comment.