```coffeescript
app = require('../app')
test_server = null
url = require('url')

before( (done) ->
  app.start 3001, (err, server) ->
    test_server = server
    done()
)

after( (done) ->
  test_server.close () -> done()
)

beforeEach( (done) ->
  global.sequelize.sync({force: true}).success(() -> done())
)

exports.appurl = (path) ->
  url.resolve('http://localhost:3001', path)
```

Drop mongodb database between tests
user
```coffeescript
app = require('../app')
test_server = null
url = require('url')

before( (done) ->
  app.start 3001, (err, server) ->
    test_server = server
    done()
)

after( (done) ->
  test_server.close () -> done()
)

dropDatabase = (connection, done) ->
  connection.db.dropDatabase (err) ->
    if err?
      console.log 'ERROR'
      console.log err
    else
      done()

beforeEach( (done) ->
  connection = mongoose.connection
  state = connection.readyState

  if state == 2
    connection.on 'open', -> dropDatabase(connection, done)
  else if state == 1
    dropDatabase(connection, done)
)

exports.appurl = (path) ->
  url.resolve('http://localhost:3001', path)
```
assistant