I\'m using mocha for javascript unit-testing now.
I have several test files, each file has a before and beforeEach, but they are exactly the s
before
beforeEach
Declare a before or beforeEach in a separate file (I use spec_helper.coffee) and require it.
spec_helper.coffee
afterEach (done) -> async.parallel [ (cb) -> Listing.remove {}, cb (cb) -> Server.remove {}, cb ], -> done()
test_something.coffee
require './spec_helper'