Comparing version 0.6.2 to 0.7.0
@@ -326,14 +326,13 @@ // Load modules | ||
} | ||
else { | ||
var stack = hideStack ? '' : exports.displayStack(1).join('\n\t'); | ||
console.log('ABORT: ' + message + '\n\t' + stack); | ||
process.exit(1); | ||
} | ||
var stack = hideStack ? '' : exports.displayStack(1).join('\n\t'); | ||
console.log('ABORT: ' + message + '\n\t' + stack); | ||
process.exit(1); | ||
}; | ||
exports.assert = function (condition, message, hideStack) { | ||
exports.assert = function (condition, message) { | ||
if (!condition) { | ||
exports.abort(message, hideStack); | ||
throw new Error(message || 'Unknown error'); | ||
} | ||
@@ -340,0 +339,0 @@ }; |
{ | ||
"name": "hoek", | ||
"description": "General purpose node utilities", | ||
"version": "0.6.2", | ||
"version": "0.7.0", | ||
"author": "Eran Hammer <eran@hueniverse.com> (http://hueniverse.com)", | ||
@@ -6,0 +6,0 @@ "contributors":[ |
@@ -458,27 +458,2 @@ // Load modules | ||
}); | ||
it('should respect hideStack argument', function (done) { | ||
var env = process.env.NODE_ENV; | ||
var write = process.stdout.write; | ||
var exit = process.exit; | ||
var output = ''; | ||
process.exit = function () {}; | ||
process.env.NODE_ENV = ''; | ||
process.stdout.write = function (message) { | ||
output = message; | ||
}; | ||
Hoek.assert(false, 'my error message', true); | ||
process.env.NODE_ENV = env; | ||
process.stdout.write = write; | ||
process.exit = exit; | ||
expect(output).to.equal('ABORT: my error message\n\t\n'); | ||
done(); | ||
}); | ||
}); | ||
@@ -485,0 +460,0 @@ |
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
17
83567
877