From ef59eca978b91b25cb26ca958cd5aa9ad15b0a31 Mon Sep 17 00:00:00 2001 From: Marak Date: Wed, 17 Oct 2018 14:00:33 -0400 Subject: [test] `faker.fake` now at 100% code coverage --- test/fake.unit.js | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/test/fake.unit.js b/test/fake.unit.js index e541d938..6a802ec4 100644 --- a/test/fake.unit.js +++ b/test/fake.unit.js @@ -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); + }); + + }); }); -- cgit v1.2.3