tddmeteorlaika

meteorjs: laika client and server test timout


I'm trying out laika test framework for meteor. The second example from the homepage uses observe() and I think it is not observing correctly.

suite('Posts', function() {
    test('using both client and server', function(done, server, client) {
    server.eval(function() {
      Posts.find().observe({
        added: addedNewPost
      });
      function addedNewPost(post) {
        emit('post', post);
      }
    }).once('post', function(post) {
      assert.equal(post.title, 'hello title');
      done();
    });
    client.eval(function() {
      Posts.insert({title: 'hello title'});
    });
  });
});

I always get a timeout. Increasing the timeout period doesn't help. I can't figure out what I'm doing wrong and I can't work out how to get any more verbose output. Peppering the tests with calls to console.log() gives nothing.

output:

1) Posts using both client and the server:
 Error: timeout of 2000ms exceeded
  at null.<anonymous> (/usr/local/share/npm/lib/node_modules/laika/node_modules/mocha/lib/runnable.js:165:14)
  at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)

Solution

  • i've had a similar issue with laika, with node 0.10.10. I switched to node 0.10.4, and the timeouts disappeared.

    I don't know if your case is exactly the same as mine, but it's worth a try.