コード例 #1
0
ファイル: db.test.js プロジェクト: johnjs/observer-backend
       + 'which closes the db connection', (done) => {
   diehard.register.callsArgWithAsync(0, () => {
     assert.ok(connectionStub.close.calledOnce);
     done();
   });
   db.connect();
 });
コード例 #2
0
ファイル: queue.test.js プロジェクト: johnjs/observer-backend
          + 'which closes the queue connection', (done) => {
      const expecteMsg = 'RabbitMQ connection disconnected due to app termination';
      sandbox.stub(logger, 'logInfo');

      diehard.register.callsArgWithAsync(0, () => {
        assert.ok(logger.logInfo.calledWith(expecteMsg));
        done();
      });
      queue.createConnection();
    });