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

nodeunit

Package Overview
Dependencies
Maintainers
0
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.5.2 to 0.5.3

deps/console.log.js

41

lib/reporters/default.js

@@ -14,3 +14,2 @@ /*!

fs = require('fs'),
sys = require('sys'),
track = require('../track'),

@@ -63,4 +62,4 @@ path = require('path');

if (tracker.unfinished()) {
sys.puts('');
sys.puts(error(bold(
console.log('');
console.log(error(bold(
'FAILURES: Undone tests (or their setups/teardowns): '

@@ -70,6 +69,6 @@ )));

for (var i = 0; i < names.length; i += 1) {
sys.puts('- ' + names[i]);
console.log('- ' + names[i]);
}
sys.puts('');
sys.puts('To fix this, make sure all tests call test.done()');
console.log('');
console.log('To fix this, make sure all tests call test.done()');
process.reallyExit(tracker.unfinished());

@@ -82,3 +81,3 @@ }

moduleStart: function (name) {
sys.puts('\n' + bold(name));
console.log('\n' + bold(name));
},

@@ -89,6 +88,6 @@ testDone: function (name, assertions) {

if (!assertions.failures()) {
sys.puts('✔ ' + name);
console.log('✔ ' + name);
}
else {
sys.puts(error('✖ ' + name) + '\n');
console.log(error('✖ ' + name) + '\n');
assertions.forEach(function (a) {

@@ -98,3 +97,3 @@ if (a.failed()) {

if (a.error instanceof AssertionError && a.message) {
sys.puts(
console.log(
'Assertion Message: ' +

@@ -104,3 +103,3 @@ assertion_message(a.message)

}
sys.puts(a.error.stack + '\n');
console.log(a.error.stack + '\n');
}

@@ -110,7 +109,7 @@ });

},
done: function (assertions) {
var end = new Date().getTime();
done: function (assertions, end) {
var end = end || new Date().getTime();
var duration = end - start;
if (assertions.failures()) {
sys.puts(
console.log(
'\n' + bold(error('FAILURES: ')) + assertions.failures() +

@@ -122,15 +121,7 @@ '/' + assertions.length + ' assertions failed (' +

else {
sys.puts(
'\n' + bold(ok('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
console.log(
'\n' + bold(ok('OK: ')) + assertions.length +
' assertions (' + assertions.duration + 'ms)'
);
}
// alexgorbatchev 2010-11-10 :: should be able to flush stdout
// here, but doesn't seem to work, instead delay the exit to give
// enough to time flush.
// process.stdout.flush()
// process.stdout.end()
setTimeout(function () {
process.reallyExit(assertions.failures());
}, 10);
},

@@ -137,0 +128,0 @@ testStart: function(name) {

@@ -14,3 +14,2 @@ /*!

fs = require('fs'),
sys = require('sys'),
path = require('path'),

@@ -39,11 +38,11 @@ AssertionError = require('assert').AssertionError;

sys.puts('<html>');
sys.puts('<head>');
sys.puts('<title></title>');
sys.puts('<style type="text/css">');
sys.puts('body { font: 12px Helvetica Neue }');
sys.puts('h2 { margin:0 ; padding:0 }');
sys.puts('pre { font: 11px Andale Mono; margin-left: 1em; padding-left: 1em; margin-top:0; font-size:smaller;}');
sys.puts('.assertion_message { margin-left: 1em; }');
sys.puts(' ol {' +
console.log('<html>');
console.log('<head>');
console.log('<title></title>');
console.log('<style type="text/css">');
console.log('body { font: 12px Helvetica Neue }');
console.log('h2 { margin:0 ; padding:0 }');
console.log('pre { font: 11px Andale Mono; margin-left: 1em; padding-left: 1em; margin-top:0; font-size:smaller;}');
console.log('.assertion_message { margin-left: 1em; }');
console.log(' ol {' +
' list-style: none;' +

@@ -54,19 +53,19 @@ ' margin-left: 1em;' +

'}');
sys.puts(' ol li.pass:before { content: "\\2714 \\0020"; }');
sys.puts(' ol li.fail:before { content: "\\2716 \\0020"; }');
sys.puts('</style>');
sys.puts('</head>');
sys.puts('<body>');
console.log(' ol li.pass:before { content: "\\2714 \\0020"; }');
console.log(' ol li.fail:before { content: "\\2716 \\0020"; }');
console.log('</style>');
console.log('</head>');
console.log('<body>');
nodeunit.runFiles(paths, {
testspec: options.testspec,
moduleStart: function (name) {
sys.puts('<h2>' + name + '</h2>');
sys.puts('<ol>');
console.log('<h2>' + name + '</h2>');
console.log('<ol>');
},
testDone: function (name, assertions) {
if (!assertions.failures()) {
sys.puts('<li class="pass">' + name + '</li>');
console.log('<li class="pass">' + name + '</li>');
}
else {
sys.puts('<li class="fail">' + name);
console.log('<li class="fail">' + name);
assertions.forEach(function (a) {

@@ -76,16 +75,16 @@ if (a.failed()) {

if (a.error instanceof AssertionError && a.message) {
sys.puts('<div class="assertion_message">' +
console.log('<div class="assertion_message">' +
'Assertion Message: ' + a.message +
'</div>');
}
sys.puts('<pre>');
sys.puts(a.error.stack);
sys.puts('</pre>');
console.log('<pre>');
console.log(a.error.stack);
console.log('</pre>');
}
});
sys.puts('</li>');
console.log('</li>');
}
},
moduleDone: function () {
sys.puts('</ol>');
console.log('</ol>');
},

@@ -96,3 +95,3 @@ done: function (assertions) {

if (assertions.failures()) {
sys.puts(
console.log(
'<h3>FAILURES: ' + assertions.failures() +

@@ -104,3 +103,3 @@ '/' + assertions.length + ' assertions failed (' +

else {
sys.puts(
console.log(
'<h3>OK: ' + assertions.length +

@@ -110,8 +109,3 @@ ' assertions (' + assertions.duration + 'ms)</h3>'

}
sys.puts('</body>');
// should be able to flush stdout here, but doesn't seem to work,
// instead delay the exit to give enough to time flush.
setTimeout(function () {
process.reallyExit(assertions.failures());
}, 10);
console.log('</body>');
}

@@ -118,0 +112,0 @@ });

@@ -14,3 +14,2 @@ /*!

fs = require('fs'),
sys = require('sys'),
path = require('path'),

@@ -159,3 +158,3 @@ async = require('../../deps/async'),

);
sys.puts('Writing ' + filename);
console.log('Writing ' + filename);
fs.writeFile(filename, rendered, cb);

@@ -166,3 +165,3 @@ },

else if (assertions.failures()) {
sys.puts(
console.log(
'\n' + bold(error('FAILURES: ')) +

@@ -175,3 +174,3 @@ assertions.failures() + '/' +

else {
sys.puts(
console.log(
'\n' + bold(ok('OK: ')) + assertions.length +

@@ -181,5 +180,2 @@ ' assertions (' + assertions.duration + 'ms)'

}
setTimeout(function () {
process.reallyExit(assertions.failures());
}, 10);
});

@@ -186,0 +182,0 @@

@@ -14,3 +14,2 @@ /*!

fs = require('fs'),
sys = require('sys'),
path = require('path'),

@@ -63,6 +62,6 @@ AssertionError = require('assert').AssertionError;

moduleStart: function (name) {
sys.print(bold(name) + ': ');
process.stdout.write(bold(name) + ': ');
},
moduleDone: function (name, assertions) {
sys.puts('');
console.log('');
if (assertions.failures()) {

@@ -73,3 +72,3 @@ assertions.forEach(function (a) {

if (a.error instanceof AssertionError && a.message) {
sys.puts(
console.log(
'Assertion in test ' + bold(a.testname) + ': ' +

@@ -79,3 +78,3 @@ magenta(a.message)

}
sys.puts(a.error.stack + '\n');
console.log(a.error.stack + '\n');
}

@@ -90,6 +89,6 @@ });

if (!assertions.failures()) {
sys.print('.');
process.stdout.write('.');
}
else {
sys.print(red('F'));
process.stdout.write(red('F'));
assertions.forEach(function (assertion) {

@@ -104,3 +103,3 @@ assertion.testname = name;

if (assertions.failures()) {
sys.puts(
console.log(
'\n' + bold(red('FAILURES: ')) + assertions.failures() +

@@ -112,3 +111,3 @@ '/' + assertions.length + ' assertions failed (' +

else {
sys.puts(
console.log(
'\n' + bold(green('OK: ')) + assertions.length +

@@ -118,9 +117,4 @@ ' assertions (' + assertions.duration + 'ms)'

}
// should be able to flush stdout here, but doesn't seem to work,
// instead delay the exit to give enough to time flush.
setTimeout(function () {
process.reallyExit(assertions.failures());
}, 10);
}
});
};

@@ -14,3 +14,2 @@ /*!

fs = require('fs'),
sys = require('sys'),
path = require('path'),

@@ -63,7 +62,7 @@ AssertionError = require('assert').AssertionError;

moduleStart: function (name) {
sys.puts('\n' + bold(name));
console.log('\n' + bold(name));
},
testDone: function (name, assertions) {
if (assertions.failures()) {
sys.puts(error('✖ ' + name) + '\n');
console.log(error('✖ ' + name) + '\n');
assertions.forEach(function (a) {

@@ -73,7 +72,7 @@ if (a.failed()) {

if (a.error instanceof AssertionError && a.message) {
sys.puts(
console.log(
'Assertion Message: ' + assertion_message(a.message)
);
}
sys.puts(a.error.stack + '\n');
console.log(a.error.stack + '\n');
}

@@ -85,6 +84,6 @@ });

if (!assertions.failures()) {
sys.puts('✔ all tests passed');
console.log('✔ all tests passed');
}
else {
sys.puts(error('✖ some tests failed'));
console.log(error('✖ some tests failed'));
}

@@ -96,3 +95,3 @@ },

if (assertions.failures()) {
sys.puts(
console.log(
'\n' + bold(error('FAILURES: ')) + assertions.failures() +

@@ -104,3 +103,3 @@ '/' + assertions.length + ' assertions failed (' +

else {
sys.puts(
console.log(
'\n' + bold(ok('OK: ')) + assertions.length +

@@ -110,9 +109,4 @@ ' assertions (' + assertions.duration + 'ms)'

}
// should be able to flush stdout here, but doesn't seem to work,
// instead delay the exit to give enough to time flush.
setTimeout(function () {
process.reallyExit(assertions.failures());
}, 10);
}
});
};

@@ -6,5 +6,3 @@ /*!

var sys = require('sys');
exports.createTracker = function (on_exit) {

@@ -43,7 +41,7 @@ var names = {};

if (tracker.unfinished()) {
sys.puts('');
sys.puts('Undone tests (or their setups/teardowns): ');
console.log('');
console.log('Undone tests (or their setups/teardowns): ');
var names = tracker.names();
for (var i = 0; i < names.length; i += 1) {
sys.puts(names[i]);
console.log(names[i]);
}

@@ -50,0 +48,0 @@ process.reallyExit(tracker.unfinished());

@@ -13,3 +13,3 @@ /*!

fs = require('fs'),
sys = require('sys'),
util = require('util'),
Script = process.binding('evals').Script,

@@ -194,4 +194,4 @@ http = require('http');

// alexgorbatchev 2010-10-22 :: Added a bit of depth to inspection
var actual = sys.inspect(e.actual, false, 10).replace(/\n$/, '');
var expected = sys.inspect(e.expected, false, 10).replace(/\n$/, '');
var actual = util.inspect(e.actual, false, 10).replace(/\n$/, '');
var expected = util.inspect(e.expected, false, 10).replace(/\n$/, '');
var multiline = (

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

@@ -39,4 +39,7 @@ { "name": "nodeunit"

}
, { "name": "Elijah Insua <tmpvar@gmail.com>",
"web": "http://tmpvar.com"
}
]
, "version": "0.5.2"
, "version": "0.5.3"
, "repository" :

@@ -43,0 +46,0 @@ { "type" : "git"

@@ -330,9 +330,8 @@ Nodeunit

catch(e) {
var sys = require('sys');
sys.puts("Cannot find nodeunit module.");
sys.puts("You can download submodules for this project by doing:");
sys.puts("");
sys.puts(" git submodule init");
sys.puts(" git submodule update");
sys.puts("");
console.log("Cannot find nodeunit module.");
console.log("You can download submodules for this project by doing:");
console.log("");
console.log(" git submodule init");
console.log(" git submodule update");
console.log("");
process.exit();

@@ -339,0 +338,0 @@ }

var assert = require('assert'),
sys = require('sys'),
fs = require('fs'),

@@ -4,0 +3,0 @@ path = require('path'),

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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