unexpected-messy
Advanced tools
Comparing version 1.2.1 to 1.3.0
@@ -91,2 +91,3 @@ var messy = require('messy'), | ||
function expectMessageToSatisfy(expect, subject, value) { | ||
subject.upgradeOrDowngradeBodyToMatchSpec(value); | ||
try { | ||
@@ -98,5 +99,4 @@ if (typeof value === 'string') { | ||
subject.upgradeOrDowngradeBodyToMatchSpec(value); | ||
if ('body' in value) { | ||
if (isRegExp(value.body)) { | ||
if (isRegExp(value.body) || typeof value.body === 'function') { | ||
expect(subject.body, 'to satisfy', value.body); | ||
@@ -123,3 +123,7 @@ } else { | ||
try { | ||
expect(subject.body, 'to satisfy', value.body); | ||
if (isRegExp(value.body) || typeof value.body === 'function') { | ||
expect(subject.body, 'to satisfy', value.body); | ||
} else { | ||
expect(subject.body, 'to equal', value.body); | ||
} | ||
} catch (e) { | ||
@@ -165,3 +169,3 @@ bodyDiffError = e; | ||
identify: function (obj) { | ||
return obj instanceof messy.Headers; | ||
return obj && obj.isMessyHeaders; | ||
}, | ||
@@ -349,3 +353,3 @@ equal: function (headers1, headers2) { | ||
identify: function (obj) { | ||
return obj instanceof messy.Message; | ||
return obj && obj.isMessyMessage; | ||
}, | ||
@@ -421,3 +425,3 @@ equal: function (message1, message2) { | ||
identify: function (obj) { | ||
return obj instanceof messy.RequestLine; | ||
return obj && obj.isMessyRequestLine; | ||
}, | ||
@@ -499,3 +503,3 @@ equal: function (requestLine1, requestLine2) { | ||
identify: function (obj) { | ||
return obj instanceof messy.HttpRequest; | ||
return obj && obj.isMessyHttpRequest; | ||
}, | ||
@@ -565,3 +569,3 @@ equal: function (httpRequest1, httpRequest2) { | ||
identify: function (obj) { | ||
return obj instanceof messy.StatusLine; | ||
return obj && obj.isMessyStatusLine; | ||
}, | ||
@@ -649,3 +653,3 @@ equal: function (statusLine1, statusLine2) { | ||
identify: function (obj) { | ||
return obj instanceof messy.HttpResponse; | ||
return obj && obj.isMessyHttpResponse; | ||
}, | ||
@@ -721,3 +725,3 @@ inspect: function (httpResponse, depth, output, inspect) { | ||
identify: function (obj) { | ||
return obj instanceof messy.HttpExchange; | ||
return obj && obj.isMessyHttpExchange; | ||
}, | ||
@@ -804,3 +808,3 @@ inspect: function (httpExchange, depth, output, inspect) { | ||
identify: function (obj) { | ||
return obj instanceof messy.HttpConversation; | ||
return obj && obj.isMessyHttpConversation; | ||
}, | ||
@@ -807,0 +811,0 @@ inspect: function (httpConversation, depth, output, inspect) { |
{ | ||
"name": "unexpected-messy", | ||
"version": "1.2.1", | ||
"version": "1.3.0", | ||
"description": "Unexpected plugin for the messy library", | ||
@@ -35,3 +35,3 @@ "main": "lib/unexpectedMessy.js", | ||
"peerDependencies": { | ||
"messy": "~1.2.2", | ||
"messy": "~1.3.1", | ||
"unexpected": ">=5.0.0-beta10" | ||
@@ -43,3 +43,3 @@ }, | ||
"jshint": "2.5.5", | ||
"messy": "=1.2.2", | ||
"messy": "=1.3.1", | ||
"mocha": "=1.21.4", | ||
@@ -46,0 +46,0 @@ "unexpected": ">=5.0.0-beta10" |
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
107656
2045