node-mocks-http
Advanced tools
Comparing version 1.4.2 to 1.4.3
@@ -245,2 +245,6 @@ 'use strict'; | ||
} | ||
mockResponse.emit('send'); | ||
mockResponse.emit('end'); | ||
}; | ||
@@ -247,0 +251,0 @@ |
@@ -5,3 +5,3 @@ { | ||
"description": "Mock 'http' objects for testing Express routing functions", | ||
"version": "1.4.2", | ||
"version": "1.4.3", | ||
"homepage": "https://github.com/howardabrams/node-mocks-http", | ||
@@ -48,7 +48,6 @@ "bugs": { | ||
"chai": "^2.2.0", | ||
"eslint": "^0.18.0", | ||
"eslint-plugin-mocha": "^0.2.2", | ||
"eslint": "^0.22.1", | ||
"gulp": "^3.8.11", | ||
"gulp-eslint": "^0.8.0", | ||
"gulp-istanbul": "^0.8.1", | ||
"gulp-eslint": "^0.12.0", | ||
"gulp-istanbul": "^0.9.0", | ||
"gulp-mocha": "^2.0.1", | ||
@@ -55,0 +54,0 @@ "istanbul": "^0.3.13", |
@@ -143,2 +143,3 @@ [![node-mocks-http logo][nmh-logo]][nmh-url] | ||
* [v1.4.3][release-v1.4.3] - June 3, 2015 | ||
* [v1.4.2][release-v1.4.2] - April 30, 2015 | ||
@@ -176,2 +177,3 @@ * [v1.4.1][release-v1.4.1] - April 14, 2015 | ||
[release-v1.4.3]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.3 | ||
[release-v1.4.2]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.2 | ||
@@ -178,0 +180,0 @@ [release-v1.4.1]: https://github.com/howardabrams/node-mocks-http/releases/tag/v1.4.1 |
@@ -468,5 +468,23 @@ 'use strict'; | ||
describe('.json()', function() { | ||
var response; | ||
beforeEach(function() { | ||
response = mockResponse.createResponse(); | ||
sinon.spy(response, 'emit'); | ||
}); | ||
afterEach(function() { | ||
response.emit.restore(); | ||
response = null; | ||
}); | ||
it('method should mimic Express Response.json()'); | ||
it('should emit send and end events', function() { | ||
response.json({}); | ||
expect(response.emit).to.have.been.calledTwice; | ||
expect(response.emit).to.have.been.calledWith('send'); | ||
expect(response.emit).to.have.been.calledWith('end'); | ||
}); | ||
}); | ||
@@ -473,0 +491,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
10
184
0
103660
27
2113