unexpected-messy
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -137,7 +137,7 @@ var messy = require('messy'), | ||
} else if (flags.exhaustively && !subject.hasEmptyBody()) { | ||
if (typeof message.body === 'string') { | ||
output.text(message.body); | ||
if (typeof subject.body === 'string') { | ||
output.text(subject.body); | ||
} else { | ||
// Buffer instance or parsed JSON | ||
output.append(inspect(message.body, depth)); | ||
output.append(inspect(subject.body)); | ||
} | ||
@@ -291,5 +291,6 @@ output.sp().error('// should be removed'); | ||
var subjectHeaderValues = subject.getAll(headerName), | ||
subjectHeaderValue, | ||
i; | ||
for (i = 0 ; i < subjectHeaderValues.length ; i += 1) { | ||
var subjectHeaderValue = subjectHeaderValues[i]; | ||
subjectHeaderValue = subjectHeaderValues[i]; | ||
if (remainingExpectedHeaders.has(headerName)) { | ||
@@ -316,3 +317,4 @@ var satisfiedIndex = -1; | ||
for (i = 0 ; i < subjectHeaderValues.length ; i += 1) { | ||
outputHeader(headerName, subjectHeaderValues[i]); | ||
subjectHeaderValue = subjectHeaderValues[i]; | ||
outputHeader(headerName, subjectHeaderValue); | ||
if (remainingExpectedHeaders.has(headerName)) { | ||
@@ -343,3 +345,3 @@ var expectedHeaderValue = remainingExpectedHeaders.get(headerName); // Will be the first if multiple | ||
}; | ||
} | ||
}; | ||
} | ||
@@ -440,3 +442,3 @@ expect.fail(e); | ||
if (typeof requestLine.protocolName !== 'undefined' || typeof requestLine.protocolVersion !== 'undefined') { | ||
output.sp(isFirstFragment ? 0 : 1) | ||
output.sp(isFirstFragment ? 0 : 1); | ||
if (typeof requestLine.protocolName !== 'undefined') { | ||
@@ -446,3 +448,3 @@ output.text(requestLine.protocolName, 'blue'); | ||
if (typeof requestLine.protocolVersion !== 'undefined') { | ||
output.text('/' + requestLine.protocolVersion, 'cyan') | ||
output.text('/' + requestLine.protocolVersion, 'cyan'); | ||
} | ||
@@ -586,3 +588,3 @@ } | ||
if (typeof statusLine.protocolVersion !== 'undefined') { | ||
output.text('/' + statusLine.protocolVersion, 'cyan') | ||
output.text('/' + statusLine.protocolVersion, 'cyan'); | ||
} | ||
@@ -599,3 +601,3 @@ isFirstFragment = false; | ||
output.sp(isFirstFragment ? 0 : 1) | ||
.text(statusLine.statusMessage, 'yellow') | ||
.text(statusLine.statusMessage, 'yellow'); | ||
} | ||
@@ -602,0 +604,0 @@ return output; |
{ | ||
"name": "unexpected-messy", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "Unexpected plugin for the messy library", | ||
@@ -5,0 +5,0 @@ "main": "lib/unexpectedMessy.js", |
@@ -1037,3 +1037,3 @@ /*global describe, it*/ | ||
request: 'GET / HTTP/1.1\r\nContent-Type: application/json\r\n\r\n{"foo":"bar"}', | ||
response: 'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nargh', | ||
response: 'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nargh' | ||
}), 'to satisfy', {request: {url: '/foo'}, response: {body: 'blah'}}); | ||
@@ -1070,3 +1070,3 @@ }, 'to throw', | ||
request: 'GET / HTTP/1.1\r\nContent-Type: application/json\r\n\r\n{"foo":"bar"}', | ||
response: 'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nargh', | ||
response: 'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nargh' | ||
}), 'to satisfy', {request: {url: '/'}, response: {body: 'blah'}}); | ||
@@ -1103,3 +1103,3 @@ }, 'to throw', | ||
request: 'GET / HTTP/1.1\r\nContent-Type: application/json\r\n\r\n{"foo":"bar"}', | ||
response: 'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nargh', | ||
response: 'HTTP/1.1 200 OK\r\nContent-Type: text/html\r\n\r\nargh' | ||
}), 'to satisfy', {request: {url: '/foo'}, response: {body: 'argh'}}); | ||
@@ -1106,0 +1106,0 @@ }, 'to throw', |
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
110419
11
2089