unexpected-messy
Advanced tools
Comparing version 4.2.0 to 4.3.0
@@ -1,4 +0,5 @@ | ||
/*global messy:true*/ | ||
/*global messy:true, global*/ | ||
var argv = require('minimist')(process.argv.slice(2)); | ||
global.require = require; | ||
messy = require('messy'); | ||
@@ -5,0 +6,0 @@ var unexpected = require('unexpected').clone().installPlugin(require('./lib/unexpectedMessy')); |
{ | ||
"name": "unexpected-messy", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "Unexpected plugin for the messy library", | ||
@@ -15,3 +15,3 @@ "main": "lib/unexpectedMessy.js", | ||
"generate-site": "node ./generate-site.js", | ||
"update-examples": "node ./generate-site.js --update-examples" | ||
"update-examples": "node ./generate-site.js --update-examples && npm run generate-site" | ||
}, | ||
@@ -38,4 +38,4 @@ "repository": { | ||
"peerDependencies": { | ||
"messy": "^6.3.0", | ||
"unexpected": "8 || 9" | ||
"messy": "^6.4.0", | ||
"unexpected": "9" | ||
}, | ||
@@ -46,6 +46,6 @@ "devDependencies": { | ||
"jshint": "2.5.5", | ||
"messy": "6.3.0", | ||
"messy": "6.4.0", | ||
"mocha": "2.2.5", | ||
"unexpected": "8.5.0", | ||
"unexpected-documentation-site-generator": "2.2.3" | ||
"unexpected": "9.0.0", | ||
"unexpected-documentation-site-generator": "2.5.1" | ||
}, | ||
@@ -52,0 +52,0 @@ "dependencies": { |
@@ -78,2 +78,45 @@ /*global unexpected*/ | ||
it("assertions/messy.HttpResponse/to-satisfy.md contains correct examples", function () { | ||
var testPromises = []; | ||
try { | ||
var httpResponse = new messy.HttpResponse({ | ||
headers: { | ||
'Content-Type': 'image/png' | ||
}, | ||
body: require('fs').readFileSync('node_modules/unexpected/node_modules/magicpen/images/magic-pen-6-colours.jpg') | ||
}); | ||
expect(httpResponse, 'to satisfy', { headers: { 'Content-Type': 'image/gif' } }); | ||
expect.fail(function (output) { | ||
output.error("expected:").nl(); | ||
output.code("var httpResponse = new messy.HttpResponse({").nl(); | ||
output.code(" headers: {").nl(); | ||
output.code(" 'Content-Type': 'image/png'").nl(); | ||
output.code(" },").nl(); | ||
output.code(" body: require('fs').readFileSync('node_modules/unexpected/node_modules/magicpen/images/magic-pen-6-colours.jpg')").nl(); | ||
output.code("});").nl(); | ||
output.code("").nl(); | ||
output.code("expect(httpResponse, 'to satisfy', { headers: { 'Content-Type': 'image/gif' } });").nl(); | ||
output.error("to throw"); | ||
}); | ||
} catch (e) { | ||
expect(e, "to have message", | ||
"expected\n" + | ||
"\n" + | ||
"Content-Type: image/png\n" + | ||
"\n" + | ||
"Buffer([0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01 /* 13493 more */ ])\n" + | ||
"to satisfy { headers: { 'Content-Type': 'image/gif' } }\n" + | ||
"\n" + | ||
"\n" + | ||
"Content-Type: image/png // should equal image/gif\n" + | ||
" // -image/png\n" + | ||
" // +image/gif\n" + | ||
"\n" + | ||
"Buffer([0xFF, 0xD8, 0xFF, 0xE0, 0x00, 0x10, 0x4A, 0x46, 0x49, 0x46, 0x00, 0x01, 0x01, 0x00, 0x00, 0x01 /* 13493 more */ ])" | ||
); | ||
} | ||
return expect.promise.all(testPromises); | ||
}); | ||
it("index.md contains correct examples", function () { | ||
@@ -80,0 +123,0 @@ var testPromises = []; |
Sorry, the diff of this file is too big to display
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
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
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
220493
4009
2