unexpected-messy
Advanced tools
Comparing version 1.4.0 to 1.4.1
@@ -142,3 +142,3 @@ var messy = require('messy'), | ||
if (bodyDiffError) { | ||
output.sp().error('// should satisfy ').append(inspect(value.body)); | ||
output.sp().error('// ' + (bodyDiffError.label || 'should satisfy') + ' ').append(inspect(value.body)); | ||
} | ||
@@ -222,3 +222,3 @@ } else if (flags.exhaustively && !subject.hasEmptyBody()) { | ||
var expectedHeaderValue = remainingExpectedHeaders.get(headerName); | ||
output.sp().error('// should be: ').text(expectedHeaderValue); | ||
output.sp().error('// should be ').text(expectedHeaderValue); | ||
remainingExpectedHeaders.remove(headerName, expectedHeaderValue); | ||
@@ -234,3 +234,3 @@ } else { | ||
remainingExpectedHeaders.getAll(headerName).forEach(function (headerValue) { | ||
output.nl(isFirstHeader ? 0 : 1).error('// missing: '); | ||
output.nl(isFirstHeader ? 0 : 1).error('// missing '); | ||
isFirstHeader = false; | ||
@@ -326,4 +326,3 @@ outputHeader(headerName, headerValue, true); | ||
} catch (e) { | ||
// https://github.com/sunesimonsen/unexpected/issues/76 | ||
output.sp().error('// should ' + (typeof expectedHeaderValue === 'string' ? 'be ' : 'satisfy ')).text(expectedHeaderValue); | ||
output.sp().error('// ' + (e.label || 'should satisfy') + ' ').text(expectedHeaderValue); | ||
} | ||
@@ -341,3 +340,3 @@ remainingExpectedHeaders.remove(headerName, 0); | ||
remainingExpectedHeaders.getAll(headerName).forEach(function (headerValue) { | ||
output.error('// missing: '); | ||
output.error('// missing '); | ||
outputHeader(headerName, headerValue).nl(); | ||
@@ -344,0 +343,0 @@ }); |
{ | ||
"name": "unexpected-messy", | ||
"version": "1.4.0", | ||
"version": "1.4.1", | ||
"description": "Unexpected plugin for the messy library", | ||
@@ -36,3 +36,3 @@ "main": "lib/unexpectedMessy.js", | ||
"messy": "~1.3.1", | ||
"unexpected": ">=5.0.0-beta13" | ||
"unexpected": ">=5.0.0-beta14" | ||
}, | ||
@@ -45,4 +45,4 @@ "devDependencies": { | ||
"mocha": "=1.21.4", | ||
"unexpected": ">=5.0.0-beta13" | ||
"unexpected": ">=5.0.0-beta14" | ||
} | ||
} |
@@ -53,3 +53,3 @@ /*global describe, it*/ | ||
'Quux: Baz\n' + | ||
'// missing: Baz: Blah' | ||
'// missing Baz: Blah' | ||
); | ||
@@ -74,4 +74,4 @@ }); | ||
], 'to produce a diff of', | ||
'Foo: Bar // should be: Baz\n' + | ||
'Quux: Baz // should be: Blaz' | ||
'Foo: Bar // should be Baz\n' + | ||
'Quux: Baz // should be Blaz' | ||
); | ||
@@ -86,3 +86,3 @@ }); | ||
'Foo: Baz\n' + | ||
'Foo: Bar // should be: Blah' | ||
'Foo: Bar // should be Blah' | ||
); | ||
@@ -97,3 +97,3 @@ }); | ||
'Foo: Bar\n' + | ||
'Foo: Baz // should be: Blaz' | ||
'Foo: Baz // should be Blaz' | ||
); | ||
@@ -184,6 +184,4 @@ }); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'Foo: a\n' + | ||
'Bar: b // should satisfy /c/'); | ||
'Bar: b // should match /c/'); | ||
}); | ||
@@ -219,3 +217,3 @@ }); | ||
'Content-Type: application/json\n' + | ||
'// missing: Quux: Baz\n' + | ||
'// missing Quux: Baz\n' + | ||
'\n' + | ||
@@ -236,3 +234,3 @@ '{\n' + | ||
'{\n' + | ||
' foo: 123 // should be: 456\n' + | ||
' foo: 123 // should be 456\n' + | ||
'}' | ||
@@ -363,8 +361,6 @@ ); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'Foo: a\n' + | ||
'Bar: b // should satisfy /c/\n' + | ||
'Bar: b // should match /c/\n' + | ||
'\n' + | ||
'foo // should satisfy /bar/'); | ||
'foo // should match /bar/'); | ||
}); | ||
@@ -411,4 +407,2 @@ }); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should satisfy { method: /^P(?:UT|POST)$/ }' | ||
@@ -424,4 +418,2 @@ ); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should be POST /' | ||
@@ -576,6 +568,4 @@ ); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should be POST\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -603,6 +593,4 @@ '-argh\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -630,4 +618,2 @@ '-argh\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should be POST\n' + | ||
@@ -656,6 +642,4 @@ 'Content-Type: text/html\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should be POST\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -705,4 +689,2 @@ 'argh' | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'HTTP/1.1 200 OK // should satisfy { protocolVersion: /^2\\.\\d+$/ }' | ||
@@ -718,4 +700,2 @@ ); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'HTTP/1.1 200 OK // should be 412 Precondition Failed' | ||
@@ -764,3 +744,3 @@ ); | ||
'Content-Type: application/json\n' + | ||
'// missing: Quux: Baz\n' + | ||
'// missing Quux: Baz\n' + | ||
'\n' + | ||
@@ -861,6 +841,4 @@ '{\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'HTTP/1.1 200 OK // should be 412 Precondition Failed\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -888,6 +866,4 @@ '-argh\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'HTTP/1.1 200 OK\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -915,6 +891,4 @@ '-argh\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'HTTP/1.1 200 OK\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -941,6 +915,4 @@ '-argh\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'HTTP/1.1 200 OK // should be 412 Precondition Failed\n' + | ||
'Content-Type: text/html // should be application/json\n' + | ||
'Content-Type: text/html // should equal application/json\n' + | ||
'\n' + | ||
@@ -1025,3 +997,3 @@ 'argh' | ||
'{\n' + | ||
' foo: 123 // should be: 456\n' + | ||
' foo: 123 // should be 456\n' + | ||
'}' | ||
@@ -1052,4 +1024,2 @@ ); | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should be /foo\n' + | ||
@@ -1087,4 +1057,2 @@ 'Content-Type: application/json\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1\n' + | ||
@@ -1122,4 +1090,2 @@ 'Content-Type: application/json\n' + | ||
'\n' + | ||
'Diff:\n' + | ||
'\n' + | ||
'GET / HTTP/1.1 // should be /foo\n' + | ||
@@ -1219,3 +1185,3 @@ 'Content-Type: application/json\n' + | ||
'{\n' + | ||
' foo: 123 // should be: 456\n' + | ||
' foo: 123 // should be 456\n' + | ||
'}\n' + | ||
@@ -1235,3 +1201,3 @@ '\n' + | ||
'{\n' + | ||
' foo: 123 // should be: 456\n' + | ||
' foo: 123 // should be 456\n' + | ||
'}' | ||
@@ -1276,3 +1242,3 @@ ); | ||
'{\n' + | ||
' foo: 123 // should be: 456\n' + | ||
' foo: 123 // should be 456\n' + | ||
'}\n' + | ||
@@ -1329,3 +1295,3 @@ '\n' + | ||
'{\n' + | ||
' foo: 123 // should be: 456\n' + | ||
' foo: 123 // should be 456\n' + | ||
'}\n' + | ||
@@ -1332,0 +1298,0 @@ '\n' + |
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
107309
2023