diff --git a/lib/mock-request.js b/lib/mock-request.js index 2403382..abf04e4 100644 --- a/lib/mock-request.js +++ b/lib/mock-request.js @@ -141,6 +141,39 @@ MockRequest.prototype.del = function (path, body, headers) { return this.request('DELETE', path, body, headers); }; +// +// ### function head (path, headers) +// #### @path {string} Path to expect in this mock request. +// #### @headers {Object} **Optional** Headers to expect in this mock request. +// Appends a new `HEAD` request to the sequence of mock `request/response` pairs +// managed by this instance. +// +MockRequest.prototype.head = function (path, headers) { + return this.request('HEAD', path, null, headers); +}; + +// +// ### function patch (path, headers) +// #### @path {string} Path to expect in this mock request. +// #### @headers {Object} **Optional** Headers to expect in this mock request. +// Appends a new `PATCH` request to the sequence of mock `request/response` pairs +// managed by this instance. +// +MockRequest.prototype.patch = function (path, body, headers) { + return this.request('PATCH', path, body, headers); +}; + +// +// ### function options (path, headers) +// #### @path {string} Path to expect in this mock request. +// #### @headers {Object} **Optional** Headers to expect in this mock request. +// Appends a new `OPTIONS` request to the sequence of mock `request/response` pairs +// managed by this instance. +// +MockRequest.prototype.options = function (path, headers) { + return this.request('OPTIONS', path, headers); +}; + // // ### function respond (response) // #### @response {Object} **Optional** HTTP response data to include in the mock response diff --git a/package.json b/package.json index 02417cf..0d2f298 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "mock-request", "description": "A simple testing tool for mocking HTTP sequences of request / response pairs in node.js", - "version": "0.1.2", + "version": "0.1.3", "author": "Nodejitsu Inc. ", "maintainers": [ "indexzero "