2009-11-30 02:20:37 +00:00
|
|
|
// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
|
|
|
|
//
|
|
|
|
// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
|
|
|
|
//
|
|
|
|
// Originally from narwhal.js (http://narwhaljs.org)
|
|
|
|
// Copyright (c) 2009 Thomas Robinson <280north.com>
|
|
|
|
//
|
|
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
2010-03-15 15:00:19 +00:00
|
|
|
// of this software and associated documentation files (the 'Software'), to
|
2009-11-30 02:20:37 +00:00
|
|
|
// deal in the Software without restriction, including without limitation the
|
|
|
|
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
// sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
// furnished to do so, subject to the following conditions:
|
|
|
|
//
|
|
|
|
// The above copyright notice and this permission notice shall be included in
|
|
|
|
// all copies or substantial portions of the Software.
|
|
|
|
//
|
2010-12-02 00:36:23 +00:00
|
|
|
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
2009-11-30 02:20:37 +00:00
|
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
|
|
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
|
|
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
|
2014-11-22 15:59:48 +00:00
|
|
|
'use strict';
|
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
// UTILITY
|
2015-03-17 14:12:51 +00:00
|
|
|
const compare = process.binding('buffer').compare;
|
2015-01-21 16:36:59 +00:00
|
|
|
const util = require('util');
|
2015-05-29 17:35:43 +00:00
|
|
|
const Buffer = require('buffer').Buffer;
|
2015-01-21 16:36:59 +00:00
|
|
|
const pSlice = Array.prototype.slice;
|
2009-11-30 02:20:37 +00:00
|
|
|
|
|
|
|
// 1. The assert module provides functions that throw
|
|
|
|
// AssertionError's when particular conditions are not met. The
|
|
|
|
// assert module must conform to the following interface.
|
|
|
|
|
2015-01-21 16:36:59 +00:00
|
|
|
const assert = module.exports = ok;
|
2009-11-28 17:26:59 +00:00
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
// 2. The AssertionError is defined in assert.
|
2010-12-02 00:36:23 +00:00
|
|
|
// new assert.AssertionError({ message: message,
|
|
|
|
// actual: actual,
|
|
|
|
// expected: expected })
|
2009-11-30 02:20:37 +00:00
|
|
|
|
2010-12-02 00:36:23 +00:00
|
|
|
assert.AssertionError = function AssertionError(options) {
|
2013-04-14 01:48:00 +00:00
|
|
|
this.name = 'AssertionError';
|
2009-12-29 18:37:40 +00:00
|
|
|
this.actual = options.actual;
|
|
|
|
this.expected = options.expected;
|
|
|
|
this.operator = options.operator;
|
2013-09-11 16:18:25 +00:00
|
|
|
if (options.message) {
|
|
|
|
this.message = options.message;
|
|
|
|
this.generatedMessage = false;
|
|
|
|
} else {
|
|
|
|
this.message = getMessage(this);
|
|
|
|
this.generatedMessage = true;
|
|
|
|
}
|
2009-12-29 19:14:58 +00:00
|
|
|
var stackStartFunction = options.stackStartFunction || fail;
|
2013-04-03 16:43:17 +00:00
|
|
|
Error.captureStackTrace(this, stackStartFunction);
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
2012-07-25 17:34:13 +00:00
|
|
|
|
|
|
|
// assert.AssertionError instanceof Error
|
2010-10-11 21:04:09 +00:00
|
|
|
util.inherits(assert.AssertionError, Error);
|
2009-11-30 02:20:37 +00:00
|
|
|
|
2011-08-09 21:18:16 +00:00
|
|
|
function truncate(s, n) {
|
2015-01-29 01:05:53 +00:00
|
|
|
if (typeof s === 'string') {
|
2011-08-09 21:18:16 +00:00
|
|
|
return s.length < n ? s : s.slice(0, n);
|
|
|
|
} else {
|
|
|
|
return s;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-14 01:48:00 +00:00
|
|
|
function getMessage(self) {
|
2015-01-30 15:25:32 +00:00
|
|
|
return truncate(util.inspect(self.actual), 128) + ' ' +
|
2013-04-14 01:48:00 +00:00
|
|
|
self.operator + ' ' +
|
2015-01-30 15:25:32 +00:00
|
|
|
truncate(util.inspect(self.expected), 128);
|
2013-04-03 16:43:17 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
|
|
|
|
// At present only the three keys mentioned above are used and
|
|
|
|
// understood by the spec. Implementations or sub modules can pass
|
|
|
|
// other keys to the AssertionError's constructor - they will be
|
|
|
|
// ignored.
|
|
|
|
|
|
|
|
// 3. All of the following functions must throw an AssertionError
|
|
|
|
// when a corresponding condition is not met, with a message that
|
|
|
|
// may be undefined if not provided. All assertion methods provide
|
|
|
|
// both the actual and expected values to the assertion error for
|
|
|
|
// display purposes.
|
|
|
|
|
2009-12-29 19:14:58 +00:00
|
|
|
function fail(actual, expected, message, operator, stackStartFunction) {
|
2009-12-29 18:37:40 +00:00
|
|
|
throw new assert.AssertionError({
|
|
|
|
message: message,
|
|
|
|
actual: actual,
|
|
|
|
expected: expected,
|
2009-12-29 19:14:58 +00:00
|
|
|
operator: operator,
|
|
|
|
stackStartFunction: stackStartFunction
|
2009-12-29 18:37:40 +00:00
|
|
|
});
|
2009-11-28 17:26:59 +00:00
|
|
|
}
|
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
// EXTENSION! allows for well behaved errors defined elsewhere.
|
|
|
|
assert.fail = fail;
|
|
|
|
|
2009-11-28 17:26:59 +00:00
|
|
|
// 4. Pure assertion tests whether a value is truthy, as determined
|
|
|
|
// by !!guard.
|
|
|
|
// assert.ok(guard, message_opt);
|
2012-03-11 00:48:08 +00:00
|
|
|
// This statement is equivalent to assert.equal(true, !!guard,
|
2009-11-28 17:26:59 +00:00
|
|
|
// message_opt);. To test strictly for the value true, use
|
|
|
|
// assert.strictEqual(true, guard, message_opt);.
|
|
|
|
|
2011-10-01 11:42:42 +00:00
|
|
|
function ok(value, message) {
|
2013-07-30 11:28:48 +00:00
|
|
|
if (!value) fail(value, true, message, '==', assert.ok);
|
2011-10-04 22:08:18 +00:00
|
|
|
}
|
2011-10-01 11:42:42 +00:00
|
|
|
assert.ok = ok;
|
2009-11-28 17:26:59 +00:00
|
|
|
|
|
|
|
// 5. The equality assertion tests shallow, coercive equality with
|
|
|
|
// ==.
|
|
|
|
// assert.equal(actual, expected, message_opt);
|
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
assert.equal = function equal(actual, expected, message) {
|
2010-12-02 00:36:23 +00:00
|
|
|
if (actual != expected) fail(actual, expected, message, '==', assert.equal);
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// 6. The non-equality assertion tests for whether two objects are not equal
|
|
|
|
// with != assert.notEqual(actual, expected, message_opt);
|
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
assert.notEqual = function notEqual(actual, expected, message) {
|
2010-04-11 20:46:24 +00:00
|
|
|
if (actual == expected) {
|
2010-12-02 00:36:23 +00:00
|
|
|
fail(actual, expected, message, '!=', assert.notEqual);
|
2009-12-29 19:14:58 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// 7. The equivalence assertion tests a deep equality relation.
|
|
|
|
// assert.deepEqual(actual, expected, message_opt);
|
|
|
|
|
2009-12-29 19:14:58 +00:00
|
|
|
assert.deepEqual = function deepEqual(actual, expected, message) {
|
2015-01-28 16:48:56 +00:00
|
|
|
if (!_deepEqual(actual, expected, false)) {
|
2010-12-02 00:36:23 +00:00
|
|
|
fail(actual, expected, message, 'deepEqual', assert.deepEqual);
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
|
|
|
|
2015-01-28 16:48:56 +00:00
|
|
|
assert.deepStrictEqual = function deepStrictEqual(actual, expected, message) {
|
|
|
|
if (!_deepEqual(actual, expected, true)) {
|
|
|
|
fail(actual, expected, message, 'deepStrictEqual', assert.deepStrictEqual);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
function _deepEqual(actual, expected, strict) {
|
2009-12-29 18:37:40 +00:00
|
|
|
// 7.1. All identical values are equivalent, as determined by ===.
|
|
|
|
if (actual === expected) {
|
|
|
|
return true;
|
2015-01-29 01:05:53 +00:00
|
|
|
} else if (actual instanceof Buffer && expected instanceof Buffer) {
|
2015-03-17 14:12:51 +00:00
|
|
|
return compare(actual, expected) === 0;
|
2010-09-07 23:28:49 +00:00
|
|
|
|
2009-12-29 18:37:40 +00:00
|
|
|
// 7.2. If the expected value is a Date object, the actual value is
|
|
|
|
// equivalent if it is also a Date object that refers to the same time.
|
2013-07-26 21:38:08 +00:00
|
|
|
} else if (util.isDate(actual) && util.isDate(expected)) {
|
2009-12-29 18:37:40 +00:00
|
|
|
return actual.getTime() === expected.getTime();
|
|
|
|
|
2011-02-02 11:09:02 +00:00
|
|
|
// 7.3 If the expected value is a RegExp object, the actual value is
|
2011-12-19 22:28:42 +00:00
|
|
|
// equivalent if it is also a RegExp object with the same source and
|
|
|
|
// properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
|
2013-07-26 21:38:08 +00:00
|
|
|
} else if (util.isRegExp(actual) && util.isRegExp(expected)) {
|
2011-12-19 22:28:42 +00:00
|
|
|
return actual.source === expected.source &&
|
|
|
|
actual.global === expected.global &&
|
|
|
|
actual.multiline === expected.multiline &&
|
|
|
|
actual.lastIndex === expected.lastIndex &&
|
|
|
|
actual.ignoreCase === expected.ignoreCase;
|
2011-02-02 11:09:02 +00:00
|
|
|
|
|
|
|
// 7.4. Other pairs that do not both pass typeof value == 'object',
|
2009-12-29 18:37:40 +00:00
|
|
|
// equivalence is determined by ==.
|
2015-01-29 01:05:53 +00:00
|
|
|
} else if ((actual === null || typeof actual !== 'object') &&
|
|
|
|
(expected === null || typeof expected !== 'object')) {
|
2015-01-28 16:48:56 +00:00
|
|
|
return strict ? actual === expected : actual == expected;
|
2009-12-29 18:37:40 +00:00
|
|
|
|
2015-12-17 13:05:45 +00:00
|
|
|
// If both values are instances of typed arrays, wrap them in
|
|
|
|
// a Buffer each to increase performance
|
|
|
|
} else if (ArrayBuffer.isView(actual) && ArrayBuffer.isView(expected)) {
|
2016-01-25 23:00:06 +00:00
|
|
|
return compare(Buffer.from(actual), Buffer.from(expected)) === 0;
|
2015-12-17 13:05:45 +00:00
|
|
|
|
2011-02-02 11:09:02 +00:00
|
|
|
// 7.5 For all other Object pairs, including Array objects, equivalence is
|
2009-12-29 18:37:40 +00:00
|
|
|
// determined by having the same number of owned properties (as verified
|
|
|
|
// with Object.prototype.hasOwnProperty.call), the same set of keys
|
|
|
|
// (although not necessarily the same order), equivalent values for every
|
2010-12-02 00:36:23 +00:00
|
|
|
// corresponding key, and an identical 'prototype' property. Note: this
|
2009-12-29 18:37:40 +00:00
|
|
|
// accounts for both named and indexed properties on Arrays.
|
|
|
|
} else {
|
2015-01-28 16:48:56 +00:00
|
|
|
return objEquiv(actual, expected, strict);
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
}
|
|
|
|
|
2010-12-02 00:36:23 +00:00
|
|
|
function isArguments(object) {
|
2009-12-29 18:37:40 +00:00
|
|
|
return Object.prototype.toString.call(object) == '[object Arguments]';
|
2009-11-30 02:20:37 +00:00
|
|
|
}
|
|
|
|
|
2015-01-28 16:48:56 +00:00
|
|
|
function objEquiv(a, b, strict) {
|
2015-01-29 01:05:53 +00:00
|
|
|
if (a === null || a === undefined || b === null || b === undefined)
|
2009-12-29 18:37:40 +00:00
|
|
|
return false;
|
2014-12-21 15:56:33 +00:00
|
|
|
// if one is a primitive, the other must be same
|
|
|
|
if (util.isPrimitive(a) || util.isPrimitive(b))
|
|
|
|
return a === b;
|
2015-01-28 16:48:56 +00:00
|
|
|
if (strict && Object.getPrototypeOf(a) !== Object.getPrototypeOf(b))
|
|
|
|
return false;
|
2016-01-12 21:04:50 +00:00
|
|
|
const aIsArgs = isArguments(a);
|
|
|
|
const bIsArgs = isArguments(b);
|
2014-02-24 19:16:40 +00:00
|
|
|
if ((aIsArgs && !bIsArgs) || (!aIsArgs && bIsArgs))
|
|
|
|
return false;
|
|
|
|
if (aIsArgs) {
|
2009-12-29 18:37:40 +00:00
|
|
|
a = pSlice.call(a);
|
|
|
|
b = pSlice.call(b);
|
2015-01-28 16:48:56 +00:00
|
|
|
return _deepEqual(a, b, strict);
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2016-01-12 21:04:50 +00:00
|
|
|
const ka = Object.keys(a);
|
|
|
|
const kb = Object.keys(b);
|
|
|
|
var key, i;
|
2010-12-02 00:36:23 +00:00
|
|
|
// having the same number of owned properties (keys incorporates
|
|
|
|
// hasOwnProperty)
|
2015-01-28 16:48:56 +00:00
|
|
|
if (ka.length !== kb.length)
|
2009-12-29 18:37:40 +00:00
|
|
|
return false;
|
|
|
|
//the same set of keys (although not necessarily the same order),
|
|
|
|
ka.sort();
|
|
|
|
kb.sort();
|
|
|
|
//~~~cheap key test
|
|
|
|
for (i = ka.length - 1; i >= 0; i--) {
|
2015-01-28 16:48:56 +00:00
|
|
|
if (ka[i] !== kb[i])
|
2009-12-29 18:37:40 +00:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
//equivalent values for every corresponding key, and
|
|
|
|
//~~~possibly expensive deep test
|
|
|
|
for (i = ka.length - 1; i >= 0; i--) {
|
|
|
|
key = ka[i];
|
2015-01-28 16:48:56 +00:00
|
|
|
if (!_deepEqual(a[key], b[key], strict)) return false;
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
|
|
|
return true;
|
2009-11-28 17:26:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// 8. The non-equivalence assertion tests for any deep inequality.
|
|
|
|
// assert.notDeepEqual(actual, expected, message_opt);
|
|
|
|
|
2009-12-29 19:14:58 +00:00
|
|
|
assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
|
2015-01-28 16:48:56 +00:00
|
|
|
if (_deepEqual(actual, expected, false)) {
|
2010-12-02 00:36:23 +00:00
|
|
|
fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
|
|
|
|
2015-01-28 16:48:56 +00:00
|
|
|
assert.notDeepStrictEqual = notDeepStrictEqual;
|
|
|
|
function notDeepStrictEqual(actual, expected, message) {
|
|
|
|
if (_deepEqual(actual, expected, true)) {
|
|
|
|
fail(actual, expected, message, 'notDeepStrictEqual', notDeepStrictEqual);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2009-11-28 17:26:59 +00:00
|
|
|
// 9. The strict equality assertion tests strict equality, as determined by ===.
|
|
|
|
// assert.strictEqual(actual, expected, message_opt);
|
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
assert.strictEqual = function strictEqual(actual, expected, message) {
|
2009-12-29 19:14:58 +00:00
|
|
|
if (actual !== expected) {
|
2010-12-02 00:36:23 +00:00
|
|
|
fail(actual, expected, message, '===', assert.strictEqual);
|
2009-12-29 19:14:58 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
|
|
|
|
2010-12-02 00:36:23 +00:00
|
|
|
// 10. The strict non-equality assertion tests for strict inequality, as
|
|
|
|
// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
|
2009-11-28 17:26:59 +00:00
|
|
|
|
2009-11-30 02:20:37 +00:00
|
|
|
assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
|
2009-12-29 19:14:58 +00:00
|
|
|
if (actual === expected) {
|
2010-12-02 00:36:23 +00:00
|
|
|
fail(actual, expected, message, '!==', assert.notStrictEqual);
|
2009-12-29 19:14:58 +00:00
|
|
|
}
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
|
|
|
|
2010-11-26 23:03:31 +00:00
|
|
|
function expectedException(actual, expected) {
|
|
|
|
if (!actual || !expected) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2011-02-20 23:09:23 +00:00
|
|
|
if (Object.prototype.toString.call(expected) == '[object RegExp]') {
|
2010-12-21 17:42:52 +00:00
|
|
|
return expected.test(actual);
|
2010-11-26 23:03:31 +00:00
|
|
|
}
|
2010-12-21 17:42:52 +00:00
|
|
|
|
2015-10-08 10:25:03 +00:00
|
|
|
try {
|
|
|
|
if (actual instanceof expected) {
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
// Ignore. The instanceof check doesn't work for arrow functions.
|
|
|
|
}
|
|
|
|
|
2015-12-06 01:29:28 +00:00
|
|
|
if (Error.isPrototypeOf(expected)) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2015-10-08 10:25:03 +00:00
|
|
|
return expected.call({}, actual) === true;
|
2010-11-26 23:03:31 +00:00
|
|
|
}
|
|
|
|
|
2015-12-20 07:01:34 +00:00
|
|
|
function _tryBlock(block) {
|
|
|
|
var error;
|
|
|
|
try {
|
|
|
|
block();
|
|
|
|
} catch (e) {
|
|
|
|
error = e;
|
|
|
|
}
|
|
|
|
return error;
|
|
|
|
}
|
|
|
|
|
2010-12-02 00:36:23 +00:00
|
|
|
function _throws(shouldThrow, block, expected, message) {
|
2010-11-26 23:03:31 +00:00
|
|
|
var actual;
|
|
|
|
|
2015-01-29 01:05:53 +00:00
|
|
|
if (typeof block !== 'function') {
|
2015-10-14 21:10:25 +00:00
|
|
|
throw new TypeError('"block" argument must be a function');
|
2015-01-12 16:13:18 +00:00
|
|
|
}
|
|
|
|
|
2015-01-29 01:05:53 +00:00
|
|
|
if (typeof expected === 'string') {
|
2010-11-26 23:03:31 +00:00
|
|
|
message = expected;
|
|
|
|
expected = null;
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
|
|
|
|
2015-12-20 07:01:34 +00:00
|
|
|
actual = _tryBlock(block);
|
2009-12-29 18:37:40 +00:00
|
|
|
|
2010-12-02 00:36:23 +00:00
|
|
|
message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
|
|
|
|
(message ? ' ' + message : '.');
|
2010-11-26 23:03:31 +00:00
|
|
|
|
|
|
|
if (shouldThrow && !actual) {
|
2012-03-24 07:00:14 +00:00
|
|
|
fail(actual, expected, 'Missing expected exception' + message);
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2010-11-26 23:03:31 +00:00
|
|
|
|
|
|
|
if (!shouldThrow && expectedException(actual, expected)) {
|
2012-03-24 07:00:14 +00:00
|
|
|
fail(actual, expected, 'Got unwanted exception' + message);
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2010-11-26 23:03:31 +00:00
|
|
|
|
2010-12-02 00:36:23 +00:00
|
|
|
if ((shouldThrow && actual && expected &&
|
|
|
|
!expectedException(actual, expected)) || (!shouldThrow && actual)) {
|
2010-11-26 23:03:31 +00:00
|
|
|
throw actual;
|
2009-12-29 18:37:40 +00:00
|
|
|
}
|
2010-11-26 23:03:31 +00:00
|
|
|
}
|
2009-11-30 02:20:37 +00:00
|
|
|
|
2009-12-29 18:37:40 +00:00
|
|
|
// 11. Expected to throw an error:
|
|
|
|
// assert.throws(block, Error_opt, message_opt);
|
2009-11-28 17:26:59 +00:00
|
|
|
|
2009-12-29 18:37:40 +00:00
|
|
|
assert.throws = function(block, /*optional*/error, /*optional*/message) {
|
2015-12-20 07:01:34 +00:00
|
|
|
_throws(true, block, error, message);
|
2009-12-29 18:37:40 +00:00
|
|
|
};
|
2009-11-30 02:20:37 +00:00
|
|
|
|
2009-12-29 18:37:40 +00:00
|
|
|
// EXTENSION! This is annoying to write outside this module.
|
2015-12-20 07:01:34 +00:00
|
|
|
assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
|
|
|
|
_throws(false, block, error, message);
|
2009-11-28 17:26:59 +00:00
|
|
|
};
|
2009-12-29 19:14:58 +00:00
|
|
|
|
2015-04-28 17:46:14 +00:00
|
|
|
assert.ifError = function(err) { if (err) throw err; };
|