This enables tests to hijack a constructor such as the NPM request module.