// TODO this is integration test, split these from unit tests
var assert = require('assert')
var exec = require('child_process').exec
var path = require('path')

describe('tor bin', () => {
  var cmd =
    'WORKING_DIRECTORY=$(pwd) node ' + path.join(__dirname, '../bin/tor')

  it('--help should run without errors', done => {
    exec(cmd + ' --help', error => {
      assert.equal(error, null)
      done()
    })
  })

  it('--version should run without errors', done => {
    exec(cmd + ' --version', error => {
      assert.equal(error, null)
      done()
    })
  })

  it('should return error on missing command', done => {
    this.timeout(4000)

    exec(cmd, error => {
      assert.ok(error)
      assert.equal(error.code, 1)
      done()
    })
  })

  it.skip('should return error on unknown command', done => {
    this.timeout(4000)

    exec(cmd + ' junkcmd', error => {
      assert.ok(error)
      assert.equal(error.code, 1)
      done()
    })
  })
})

@@ -179,15 +179,42 @@
 n', 
-() =%3E %7B
+function() %7B%0A  this.timeout(4000)%0A
 %0A  v
@@ -656,32 +656,8 @@
 %3E %7B%0A
-    this.timeout(4000)%0A%0A
     
@@ -826,32 +826,8 @@
 %3E %7B%0A
-    this.timeout(4000)%0A%0A
     

Fix tests