aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarak <[email protected]>2018-10-17 14:00:33 -0400
committerMarak <[email protected]>2018-10-17 18:04:44 -0400
commitef59eca978b91b25cb26ca958cd5aa9ad15b0a31 (patch)
tree2259b758e701b907f9a200acfb58353f61d8c6e8
parent09b736782621b88e779cc43903b6e2f389ae87a7 (diff)
downloadfaker-ef59eca978b91b25cb26ca958cd5aa9ad15b0a31.tar.xz
faker-ef59eca978b91b25cb26ca958cd5aa9ad15b0a31.zip
[test] `faker.fake` now at 100% code coverage
-rw-r--r--test/fake.unit.js20
1 files changed, 20 insertions, 0 deletions
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);
+ });
+
+
});
});