text: /* eslint-env mocha */
  'use strict'
  
  const chai = require('chai')
  const dirtyChai = require('dirty-chai')
  const expect = chai.expect
  chai.use(dirtyChai)
  
  const DaemonFactory = require('ipfsd-ctl')
  const df = DaemonFactory.create({ exec: 'src/cli/bin.js' })
  
  describe('version endpoint', () => {
    let ipfs = null
    let ipfsd = null
    before(function (done) {
      this.timeout(20 * 1000)
      df.spawn({ initOptions: { bits: 512 } }, (err, _ipfsd) => {
        expect(err).to.not.exist()
        ipfsd = _ipfsd
        ipfs = ipfsd.api
        done()
      })
    })
  
    after((done) => ipfsd.stop(done))
  
    describe('.version', () => {
      it('get the version', (done) => {
        ipfs.version((err, result) => {
          expect(err).to.not.exist()
          expect(result).to.have.a.property('version')
          expect(result).to.have.a.property('commit')
          expect(result).to.have.a.property('repo')
          done()
        })
      })
    })
  })
  