我正在尝试测试我的mongoose
模型,例如:
待办事项 = 需要“../../../app/todos/Todo”
describe "Todo", ->
describe "Basic CRUD", ->
before: (done) ->
console.log "In b4"
Todo.remove {}, (err) ->
console.log "removed"
done err
it "can be added to database", (done) ->
todo = new Todo
title: "New todo"
todo.save (err) ->
if !err
Todo.find { title: "New todo" }, (err, docs) ->
docs.length.should.equal 1
done(err)
else
done err
出于某种原因,before
或者beforeEach
没有触发,这是为什么呢?