wallet-core/node_modules/empower-core/lib/default-options.js
2017-05-28 00:40:43 +02:00

36 lines
1.1 KiB
JavaScript

'use strict';
module.exports = function defaultOptions () {
return {
destructive: false,
bindReceiver: true,
onError: onError,
onSuccess: onSuccess,
patterns: [
'assert(value, [message])',
'assert.ok(value, [message])',
'assert.equal(actual, expected, [message])',
'assert.notEqual(actual, expected, [message])',
'assert.strictEqual(actual, expected, [message])',
'assert.notStrictEqual(actual, expected, [message])',
'assert.deepEqual(actual, expected, [message])',
'assert.notDeepEqual(actual, expected, [message])',
'assert.deepStrictEqual(actual, expected, [message])',
'assert.notDeepStrictEqual(actual, expected, [message])'
],
wrapOnlyPatterns: []
};
};
function onError (errorEvent) {
var e = errorEvent.error;
if (errorEvent.powerAssertContext && e.name === 'AssertionError') {
e.powerAssertContext = errorEvent.powerAssertContext;
}
throw e;
}
function onSuccess(successEvent) {
return successEvent.returnValue;
}