Fairly new to the whole node.js community, and I'm having trouble with my unit tests on my first app. The problem is they pass, but they never actually run the assertions in the callbacks. As I understand it, mongoose (the library I'm using to talk to MongoDB) uses callbacks for working with it's API. In my vows tests, these callbacks don't seem to get fired. An example:
vows = require 'vows'
assert = require 'assert'
mongoose = require 'mongoose'
ProjectSchema = new Schema
name: String
Project = mongoose.model 'Project', ProjectSchema
mongoose.connect('mongodb://localhost/testdb');
projectBatch = vows.describe('Project').addBatch
'model attributes':
topic: ()->
new Project()
'should have a name field': (topic)->
topic.name = "some name"
topic.save
console.log "this gets executed just fine"
Project.findById topic.id, (error, project)->
console.log "THIS LINE NEVER RUNS!"
assert.equal "some name", project.name
projectBatch.export module
Any ideas on what I'm doing wrong here?