code: function mockService(service) {
    var nestedServices = service.split('.');
    var method = nestedServices.pop();
    var object = traverse(_AWS).get(nestedServices);
  
    var serviceStub = sinon.stub(object, method).callsFake(function(...args) {
      services[service].invoked = true;
  
      /**
       * Create an instance of the service by calling the real constructor
       * we stored before. E.g. var client = new AWS.SNS()
       * This is necessary in order to mock methods on the service.
       */
      var client = new services[service].Constructor(...args);
      services[service].client = client;
  
      // Once this has been triggered we can mock out all the registered methods.
      for (var key in services[service].methodMocks) {
        mockServiceMethod(service, client, key, services[service].methodMocks[key].replace);
      };
      return client;
    });
    services[service].stub = serviceStub;
  }
docs: Stub the constructor for the service on AWS.
  E.g. calls of new AWS.SNS() are replaced.