'use strict'

describe('.ping', function () {
  it('ping another peer', function (done) {
    apiClients['b'].id((err, id) => {
      if (err) {
        throw err
      }

      apiClients['a'].ping(id.ID, (err, res) => {
        if (err) {
          throw err
        }
        // TODO: remove before merge
        console.log(' ping ->', err, res)
        assert(res)
        assert(res.Success)
        done()
      })
    })
  })
})

'use strict'

describe('.ping', function () {
  it('ping another peer', function (done) {
    // TODO remove this when https://github.com/ipfs/js-ipfs-api/issues/135 is resolved
    if (!isNode) {
      return done()
    }

    apiClients['b'].id((err, id) => {
      if (err) {
        throw err
      }

      apiClients['a'].ping(id.ID, (err, res) => {
        if (err) {
          throw err
        }

        assert(res)
        assert(res.Success)
        done()
      })
    })
  })
})

make travis test pass (cause Firefox https://github.com/ipfs/js-ipfs-api/issues/135)