Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nodeunit

Package Overview
Dependencies
Maintainers
2
Versions
48
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodeunit - npm Package Compare versions

Comparing version 0.9.1 to 0.9.2

10

examples/browser/nodeunit.js

@@ -1944,2 +1944,4 @@ /*!

var start = new Date().getTime();
var textareas = options.textareas;
var displayErrorsByDefault = options.displayErrorsByDefault;

@@ -1993,4 +1995,4 @@ function setText(el, txt) {

var aList = document.createElement('ol');
aList.style.display = 'none';
test.onclick = function () {
aList.style.display = displayErrorsByDefault ? 'block' : 'none';
(displayErrorsByDefault ? strong : test).onclick = function () {
var d = aList.style.display;

@@ -2004,3 +2006,5 @@ aList.style.display = (d == 'none') ? 'block': 'none';

li.innerHTML = (a.message || a.method || 'no message') +
'<pre>' + (a.error.stack || a.error) + '</pre>';
(textareas ?
'<textarea rows="20" cols="100">' + (a.error.stack || a.error) + '</textarea>' :
'<pre>' + (a.error.stack || a.error) + '</pre>');
li.className = 'fail';

@@ -2007,0 +2011,0 @@ }

@@ -34,5 +34,7 @@ /*!

exports.run = function (modules, options, callback) {
var start = new Date().getTime(), div;
options = options || {};
div = options.div || document.body;
var start = new Date().getTime(), div, textareas, displayErrorsByDefault;
options = options || {};
div = options.div || document.body;
textareas = options.textareas;
displayErrorsByDefault = options.displayErrorsByDefault;

@@ -86,4 +88,4 @@ function setText(el, txt) {

var aList = document.createElement('ol');
aList.style.display = 'none';
test.onclick = function () {
aList.style.display = displayErrorsByDefault ? 'block' : 'none';
(displayErrorsByDefault ? strong : test).onclick = function () {
var d = aList.style.display;

@@ -97,3 +99,5 @@ aList.style.display = (d == 'none') ? 'block': 'none';

li.innerHTML = (a.message || a.method || 'no message') +
'<pre>' + (a.error.stack || a.error) + '</pre>';
(textareas ?
'<textarea rows="20" cols="100">' + (a.error.stack || a.error) + '</textarea>' :
'<pre>' + (a.error.stack || a.error) + '</pre>');
li.className = 'fail';

@@ -100,0 +104,0 @@ }

@@ -155,22 +155,31 @@ /*!

var client = http.createClient(port, hostname);
client.fetch = function (method, path, headers, respReady) {
var request = this.request(method, path, headers);
request.end();
request.on('response', function (response) {
response.setEncoding('utf8');
response.on('data', function (chunk) {
if (response.body) {
response.body += chunk;
} else {
response.body = chunk;
}
var agent = new http.Agent({ host: hostname, port: port, maxSockets: 1 });
var client = {
fetch: function (method, path, headers, respReady) {
var request = http.request({
host: hostname,
port: port,
agent: agent,
method: method,
path: path,
headers: headers
});
response.on('end', function () {
if (response.headers['content-type'] === 'application/json') {
response.bodyAsObject = JSON.parse(response.body);
}
respReady(response);
request.end();
request.on('response', function (response) {
response.setEncoding('utf8');
response.on('data', function (chunk) {
if (response.body) {
response.body += chunk;
} else {
response.body = chunk;
}
});
response.on('end', function () {
if (response.headers['content-type'] === 'application/json') {
response.bodyAsObject = JSON.parse(response.body);
}
respReady(response);
});
});
});
}
};

@@ -200,5 +209,7 @@

var e = assertion.error;
if (e.actual && e.expected) {
if (typeof e.actual !== 'undefined' && typeof e.expected !== 'undefined') {
var actual = util.inspect(e.actual, false, 10).replace(/\n$/, '');
var expected = util.inspect(e.expected, false, 10).replace(/\n$/, '');
var multiline = (

@@ -205,0 +216,0 @@ actual.indexOf('\n') !== -1 ||

{
"name": "nodeunit",
"version": "0.9.1",
"version": "0.9.2",
"description": "Easy unit testing for node.js and the browser.",

@@ -5,0 +5,0 @@ "maintainers": [

@@ -44,3 +44,3 @@ Nodeunit

exports.testSomething = function(test){
exports.testSomething = function(test) {
test.expect(1);

@@ -51,3 +51,3 @@ test.ok(true, "this assertion should pass");

exports.testSomethingElse = function(test){
exports.testSomethingElse = function(test) {
test.ok(false, "this assertion should fail");

@@ -138,3 +138,3 @@ test.done();

var _readFile = fs.readFile;
fs.readFile = function(path, callback){
fs.readFile = function(path, callback) {
// it's a stub!

@@ -141,0 +141,0 @@ };

@@ -33,5 +33,7 @@ /*

performBasicChecks(betterErrorString);
betterErrorString.should.include("true");
betterErrorString.should.include("false");
betterErrorString.should.include("==");
test.done();

@@ -38,0 +40,0 @@ }

@@ -119,4 +119,4 @@ var assert = require('assert'),

// git doesn't like empty directories, so we have to create one
path.exists(dir2, function (exists) {
if (!exists) {
fs.access(dir2, function (err) {
if (err) {
fs.mkdirSync(dir2, 0777);

@@ -123,0 +123,0 @@ }

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc