lib/nixt/expectations.js
function error(result, message, expected, actual) {
  var err = new AssertionError('`' + result.cmd + '`: ' + message);
  err.result = result;
  if (expected) err.expected = expected;
  if (actual) err.actual = actual;
  return err;
}
function error(result, message, expected, actual) {
  var err = new AssertionError('`' + result.cmd + '`: ' + message);
  err.result = result;
  if (expected) err.expected = expected;
  if (actual) err.actual = actual;
  return err;
}
function error ( result , message , expected , actual ) { var err = new AssertionError ( '`' + result . cmd + '`: ' + message ) ; err . result = result ; if ( expected ) err . expected = expected ; if ( actual ) err . actual = actual ; return err ; }
Create and return a new `AssertionError`.
It will assign the given `result` to it, it will also prepend the executed command
to the error message.

Assertion error is a constructor for test and validation frameworks that implements
standardized Assertion Error specification.

For more info go visit https://github.com/chaijs/assertion-error

@param {Result} result
@param {String} error message
@returns {AssertionError}
@api private
Create and return a new AssertionError . It will assign the given result to it it will also prepend the executed command to the error message .