Skip to content

Commit

Permalink
[test] faker.fake now at 100% code coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
Marak committed Oct 17, 2018
1 parent 09b7367 commit ef59eca
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/fake.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,25 @@ describe("fake.js", function () {
var random = faker.fake('{{helpers.randomize(["one", "two", "three"])}}');
assert.ok(arr.indexOf(random) > -1);
});

it("does not allow undefined parameters", function () {
assert.throws(function () {
faker.fake()
}, Error);
});

it("does not allow invalid module name", function () {
assert.throws(function () {
faker.fake('{{foo.bar}}')
}, Error);
});

it("does not allow invalid method name", function () {
assert.throws(function () {
faker.fake('{{address.foo}}')
}, Error);
});


});
});

0 comments on commit ef59eca

Please sign in to comment.