How to use the @google-cloud/common.Service.prototype function in @google-cloud/common

To help you get started, we’ve selected a few @google-cloud/common examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github googleapis / cloud-trace-nodejs / test / test-trace-writer.ts View on Github external
after(() => {
    shimmer.unwrap(Service.prototype, 'getProjectId');
    oauth2Scope.done(); // It will likely be called at least once
    nock.enableNetConnect();
  });
github googleapis / cloud-trace-nodejs / test / test-trace-writer.ts View on Github external
before(() => {
    nock.disableNetConnect();
    oauth2Scope = oauth2().persist();
    shimmer.wrap(
      Service.prototype,
      'getProjectId',
      () =>
        function(this: Service) {
          return getProjectIdOverride().then(projectId => {
            this.projectId = projectId;
            return projectId;
          });
        }
    );
  });