https://twitter.com/therealyashsriv/status/1219691914523545601

We shouldn't generate code that might cause browser or linting to complain.

https://github.com/facebook/react/blob/0cf22a56a18790ef34c71bef14f64695c0498619/packages/legacy-events/SyntheticEvent.js#L259

It's also just a confusing pattern at best.
measureInWindow: jest.fn(function measureInWindow(tag, callback) {
    invariant(
      typeof tag === 'number',
      'Expected tag to be a number, was passed %s',
      tag,
    );
    callback(10, 10, 100, 100);
  }),
  measureLayout: jest.fn(function measureLayout(
    tag,
    relativeTag,
    fail,
    success,
  ) {
    invariant(
      typeof tag === 'number',
      'Expected tag to be a number, was passed %s',
      tag,
    );
    invariant(
      typeof relativeTag === 'number',
      'Expected relativeTag to be a number, was passed %s',
      relativeTag,
    );
    success(1, 1, 100, 100);
  }),
  __takeSnapshot: jest.fn(),
};
module.exports = RCTUIManager;