     createTopic 'test', (err) ->
       done err
 
-  afterEach ->
+  afterEach (done) ->
     reader.close()
+    deleteTopic 'test', done
 
   describe 'stream compression and encryption', ->
     optionPermutations = [

describe 'integration', ->
  nsqdProcess = null
  reader = null
  topic = null
  n = 0

  before (done) ->
    temp.mkdir '/nsq', (err, dirPath) ->

          reader.connect()

  describe 'end to end', ->
    topic = 'test'
    channel = 'default'
    tcpAddress = "127.0.0.1:#{TCP_PORT}"
    writer = null
    reader = null

    beforeEach (done) ->
      writer = new nsq.Writer '127.0.0.1', TCP_PORT
      writer.on 'ready', ->
        reader = new nsq.Reader topic, channel, nsqdTCPAddresses: tcpAddress
