From c98144bb38a34c9259fa806d9d69804fe8157ba0 Mon Sep 17 00:00:00 2001 From: Emmanuel Prochasson Date: Thu, 25 Jul 2013 13:37:22 +0800 Subject: [PATCH] Trying some Unit testing. --- .meteor/release | 2 +- tests/messages.js | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/messages.js diff --git a/.meteor/release b/.meteor/release index 621e94f..f436215 100644 --- a/.meteor/release +++ b/.meteor/release @@ -1 +1 @@ -none +0.6.4.1 diff --git a/tests/messages.js b/tests/messages.js new file mode 100644 index 0000000..bc03ebd --- /dev/null +++ b/tests/messages.js @@ -0,0 +1,14 @@ +var assert = require('assert'); + +suite('Messages', function(){ + test('in the server', function(done, server){ + server.eval(function(){ + Messages.insert({to:"random", body: "Hello World!"}); + var message = Messages.find().fetch(); + emit('messages', message); + }) + }); + server.once('messages', function(message){ + assert.equal(message.length, 1); + }) +}); \ No newline at end of file