How to use the @google-cloud/common.util.noop 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 / nodejs-storage / test / file.ts View on Github external
it('should warn only once `keepAcl` parameter is passed', done => {
        file.request = util.noop;

        // since --throw-deprication is enabled using try=>catch block
        try {
          file.copy('newFile', {keepAcl: 'private'}, assert.ifError);
        } catch (err) {
          assert.strictEqual(
            err.message,
            'keepAcl parameter is not supported and will be removed in the next major'
          );
          assert.strictEqual(err.name, 'DeprecationWarning');
        }
        file2.copy('newFile2', {keepAcl: 'private'}, assert.ifError);
        done();
      });
    });
github googleapis / nodejs-spanner / test / index.ts View on Github external
beforeEach(() => {
    sandbox = sinon.createSandbox();
    fakeGapicClient = util.noop;
    // tslint:disable-next-line no-any
    (fakeGapicClient as any).scopes = [];
    fakeV1.DatabaseAdminClient = fakeGapicClient;
    fakeV1.InstanceAdminClient = fakeGapicClient;
    fakeV1.SpannerClient = fakeGapicClient;
    fakeCodec.SpannerDate = util.noop;
    fakeCodec.Int = util.noop;
    spanner = new Spanner(OPTIONS);
    spanner.projectId = OPTIONS.projectId;
    replaceProjectIdTokenOverride = null;
  });
github googleapis / nodejs-storage / test / index.ts View on Github external
it('should get buckets with a query', done => {
      const token = 'next-page-token';
      storage.request = (reqOpts: DecorateRequestOptions) => {
        assert.deepStrictEqual(reqOpts.qs, {
          project: storage.projectId,
          maxResults: 5,
          pageToken: token,
        });
        done();
      };
      storage.getBuckets({maxResults: 5, pageToken: token}, util.noop);
    });
github googleapis / nodejs-compute / test / rule.js View on Github external
it('should not use global forwarding rules', function() {
      const rule = new Rule({createRule: util.noop}, RULE_NAME);
      assert(rule instanceof FakeServiceObject);

      const calledWith = rule.calledWith_[0];

      assert.strictEqual(calledWith.baseUrl, '/forwardingRules');
    });
github googleapis / nodejs-storage / test / file.ts View on Github external
it('should make the file private to user if strict = true', done => {
      file.setMetadata = (metadata: {}, query: {}) => {
        assert.deepStrictEqual(query, {predefinedAcl: 'private'});
        done();
      };

      file.makePrivate({strict: true}, util.noop);
    });
github googleapis / nodejs-storage / test / index.ts View on Github external
it('should get buckets without a query', done => {
      storage.request = (reqOpts: DecorateRequestOptions) => {
        assert.strictEqual(reqOpts.uri, '/b');
        assert.deepStrictEqual(reqOpts.qs, {project: storage.projectId});
        done();
      };
      storage.getBuckets(util.noop);
    });
github googleapis / nodejs-compute / test / vm.js View on Github external
beforeEach(function() {
        vm.getMetadata = function(callback) {
          callback(null, METADATA);
        };

        vm.waiters.push({
          status: STATUS,
          callback: util.noop,
        });
      });
github googleapis / nodejs-logging / test / log.ts View on Github external
function createLogger(maxEntrySize?: number) {
    assignSeverityToEntriesOverride = null;

    LOGGING = {
      projectId: '{{project-id}}',
      entry: util.noop,
      request: util.noop,
      loggingService: util.noop,
      auth: util.noop,
    };

    const options: LogOptions = {};
    if (maxEntrySize) {
      options.maxEntrySize = maxEntrySize;
    }

    return new Log(LOGGING, LOG_NAME, options);
  }
github googleapis / nodejs-storage / system-test / storage.ts View on Github external
(options: CreateReadStreamOptions, done: (err: Error) => void) => {
              file
                .createReadStream(options)
                .on('error', done)
                .on('end', done)
                .on('data', util.noop);
            }
          )
github googleapis / google-cloud-node / packages / common-grpc / src / service-object.js View on Github external
GrpcServiceObject.prototype.setMetadata = function(metadata, callback) {
  var protoOpts = this.methods.setMetadata.protoOpts;
  var reqOpts = extend(true, {}, this.methods.setMetadata.reqOpts, metadata);

  this.request(protoOpts, reqOpts, callback || util.noop);
};