Socket
Socket
Sign inDemoInstall

supertest

Package Overview
Dependencies
9
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.6.1 to 0.7.0

5

History.md
0.7.0 / 2013-06-04
==================
* add error properties so test frameworks can show diffs etc. Closes #65
0.6.1 / 2013-06-02

@@ -3,0 +8,0 @@ ==================

24

lib/test.js

@@ -158,3 +158,3 @@

var b = util.inspect(res.body);
return fn(new Error('expected ' + a + ' response body, got ' + b));
return fn(error('expected ' + a + ' response body, got ' + b, body, res.body));
}

@@ -170,6 +170,6 @@ } else {

if (!body.test(res.text)) {
return fn(new Error('expected body ' + b + ' to match ' + body));
return fn(error('expected body ' + b + ' to match ' + body, body, res.body));
}
} else {
return fn(new Error('expected ' + a + ' response body, got ' + b));
return fn(error('expected ' + a + ' response body, got ' + b, body, res.body));
}

@@ -195,1 +195,19 @@ }

/**
* Return an `Error` with `msg` and results properties.
*
* @param {String} msg
* @param {Mixed} expected
* @param {Mixed} actual
* @return {Error}
* @api private
*/
function error(msg, expected, actual) {
var err = new Error(msg);
err.expected = expected;
err.actual = actual;
err.showDiff = true;
return err;
}

2

package.json
{
"name": "supertest",
"version": "0.6.1",
"version": "0.7.0",
"description": "Super-agent driven library for testing HTTP servers",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc