 Rest = require("sphere-node-connect").Rest
 
 describe "Integration", ->
-  beforeEach ->
+  beforeEach (done) ->
     @xmlImport = new XmlImport()
     @sync = new Sync Config
     rest = new Rest Config

      for p in JSON.parse(body).results
        rest.DELETE "/products/#{p.id}?version=#{p.version}", (error, response, body) =>
          expect(response.statusCode.toString()).toMatch /[24]00/

  it 'process', (done)->
    fs.readFile 'src/spec/oneProduct.xml', 'utf8', (err, content) =>

      data =
        attachments:
          oneProduct: content
      @xmlImport.process data, (msg) =>
        expect(msg.message.status).toBe true
        @xmlImport.process data, (msg) =>
          expect(msg.status).toBe true
          done()