New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More →

hock

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hock - npm Package Compare versions

Comparing version

to
1.2.0

@@ -219,2 +219,20 @@ var http = require('http'),

/**
* Hock.copy
*
* @description enqueue a COPY request into the assertion queue
*
* @param {String} url the route of the request to match
* @param {object|String} [body] the request body (if any) of the request to match
* @param {object} [headers] optionally match the request headers
* @returns {Request}
*/
Hock.prototype.copy = function (url, body, headers) {
return new Request(this, {
method: 'COPY',
url: url,
headers: headers || {}
});
};
/**
* Hock.filteringRequestBody

@@ -221,0 +239,0 @@ *

{
"name": "hock",
"description": "A mocking server for HTTP requests",
"version": "1.1.0",
"version": "1.2.0",
"author": "Maciej MaƂecki <me@mmalecki.com>",

@@ -6,0 +6,0 @@ "contributors": [

@@ -41,2 +41,3 @@ # hock [![Build Status](https://secure.travis-ci.org/mmalecki/hock.png?branch=master)](http://travis-ci.org/mmalecki/hock)

* HEAD
* COPY

@@ -43,0 +44,0 @@ ```Javascript

@@ -136,2 +136,19 @@ var http = require('http'),

it('should correctly respond to an HTTP COPY request', function(done) {
hockInstance
.copy('/copysrc')
.reply(204);
request({
uri: 'http://localhost:' + PORT + '/copysrc',
method: 'COPY'
}, function(err, res, body) {
should.not.exist(err);
should.exist(res);
res.statusCode.should.equal(204);
body.should.equal('');
done();
});
});
it('unmatched requests should throw', function () {

@@ -138,0 +155,0 @@ hockInstance