meteor add mike:mocha
This meteor package allows you to easily and safely run mocha tests within Meteor. It is built upon the Velocity testing framework.
Here's an example using CoffeeScript (or check out the full Meteor project w/ tests)
describe "Leaderboard", ->
describe "givePoints", ->
it "gives 5 points to the user", ->
#create a player
playerId = Players.insert {name: "TestUser1", score: 5}
Session.set "selected_player", playerId
givePoints()
player = Players.findOne(playerId)
chai.assert.equal 10, player.score
Players.remove {name: "TestUser1"}
You're free to write your tests in any Meteor supported extension. The chai assertion library is included within this package for your convenience.
(requires Meteor 0.9+)