All files / react-native-mock/src/mocks ErrorUtils.js

28.57% Statements 2/7
100% Branches 0/0
0% Functions 0/5
28.57% Lines 2/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 191x                   1x                
import sinon from 'sinon';
 
function execute(fun, context, args) {
  return fun.apply(context, args);
}
 
function reportError(error) {
  throw error;
}
 
module.exports = {
  apply: execute,
  applyWithGuard: execute,
  guard: sinon.spy(callback => callback),
  inGuard: sinon.spy(() => true),
  reportError,
  setGlobalHandler: sinon.spy(() => undefined)
};