it('should insert a warn logger', () => {
     let logger = sandbox.stub(LOG, 'warn');
     global.hfc.logger.warn('%s %s', 'hello', 'world');
     global.hfc.logger.warn('hello %s', 'world');
     global.hfc.logger.warn('hello world');
     sinon.assert.alwaysCalledWith(logger, 'fabric-client', 'hello world');
 });
Example #2
0
        queue.lock('1', false, function() {

         var spy = sinon.spy(queue, 'lock');
         self.clock.tick(config.lockTime);
         sinon.assert.called(spy);
         sinon.assert.alwaysCalledWith(spy, '1', true);
         done();

        });
    it('accepts from/size', () => {
      const body = { from: 50, size: 10 };

      savedObjectsClient.find(body);
      sinon.assert.calledOnce($http);
      sinon.assert.alwaysCalledWith($http, sinon.match({
        url: `${basePath}/api/saved_objects/_find?from=50&size=10`
      }));
    });
    async function run() {
      const resp = await createOrUpgradeSavedConfig({
        savedObjectsClient,
        version,
        buildNum,
        log,
      });

      sinon.assert.calledOnce(getUpgradeableConfig);
      sinon.assert.alwaysCalledWith(getUpgradeableConfig, { savedObjectsClient, version });

      return resp;
    }