From c4cf1eefded907e38377bdf0dbd37ff829add13a Mon Sep 17 00:00:00 2001 From: Ariel Shadkhan Date: Thu, 1 Oct 2020 16:42:48 +0300 Subject: add httpMethod and unit test --- lib/internet.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'lib') diff --git a/lib/internet.js b/lib/internet.js index 658607a1..9d322d48 100644 --- a/lib/internet.js +++ b/lib/internet.js @@ -131,6 +131,21 @@ var Internet = function (faker) { "sampleResults": ["https", "http"] }; + /** + * method + * + * @method faker.internet.httpMethod + */ + self.httpMethod = function () { + var httpMethods = ['GET','POST', 'PUT', 'DELETE', 'PATCH']; + return faker.random.arrayElement(httpMethods); + }; + + self.httpMethod.schema = { + "description": "Randomly generates HTTP Methods (GET, POST, PUT, DELETE, PATCH)", + "sampleResults": ["GET","POST", "PUT", "DELETE", "PATCH"] + }; + /** * url * -- cgit v1.2.3