unexpected-messy
Advanced tools
Comparing version 2.5.0 to 2.6.0
@@ -207,2 +207,16 @@ var messy = require('messy'), | ||
expectedBody = upgradedOrDowngradedMessageBodyAndSpecBody.specBody; | ||
if (value && typeof value === 'object') { | ||
this.errorMode = 'nested'; | ||
if ('fileName' in value) { | ||
expect(subject, 'to have file name satisfying', value.fileName); | ||
} | ||
if ('decodedBody' in value) { | ||
expect(subject, 'to have decoded body satisfying', value.decodedBody); | ||
} | ||
if ('text' in value) { | ||
expect(subject.toString(), 'to equal', value.text); | ||
} | ||
this.errorMode = 'default'; | ||
} | ||
try { | ||
@@ -537,4 +551,4 @@ if (typeof value === 'string') { | ||
} | ||
if (message.isMultipart && message.boundary && Array.isArray(message.body)) { | ||
message.body.forEach(function (part) { | ||
if (message.isMultipart) { | ||
message.parts.forEach(function (part) { | ||
output | ||
@@ -600,2 +614,8 @@ .text('--' + message.boundary, 'green') | ||
}).addAssertion('messy.Message', 'to [exhaustively] satisfy', expectMessageToSatisfy) | ||
.addAssertion('messy.Message', 'to have decoded body satisfying', function (expect, subject, value) { | ||
expect(subject.decodedBody, 'to satisfy', value); | ||
}) | ||
.addAssertion('messy.Message', 'to have file name satisfying', function (expect, subject, value) { | ||
expect(subject.fileName, 'to satisfy', value); | ||
}) | ||
.addType({ | ||
@@ -602,0 +622,0 @@ name: 'messy.RequestLine', |
{ | ||
"name": "unexpected-messy", | ||
"version": "2.5.0", | ||
"version": "2.6.0", | ||
"description": "Unexpected plugin for the messy library", | ||
@@ -35,3 +35,3 @@ "main": "lib/unexpectedMessy.js", | ||
"peerDependencies": { | ||
"messy": "^3.2.0", | ||
"messy": "^4.0.0", | ||
"unexpected": "5" | ||
@@ -43,3 +43,3 @@ }, | ||
"jshint": "2.5.5", | ||
"messy": "3.2.0", | ||
"messy": "4.0.0", | ||
"mocha": "2.0.1", | ||
@@ -46,0 +46,0 @@ "unexpected": "5.1.0" |
Sorry, the diff of this file is too big to display
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
126003
2337