Search code examples
meteormeteor-velocity

Velocity hangs with no errors when testing meteor app


I'm pretty new to meteor so I'm just writing a simple app but really want to make it as TDD as possible (worth mentioning I'm also new to Mocha). So I've added the mike:mocha and velocity:core packages and written a super simple initial test just to see if I can get things to work, which I've added at tests/mocha/client/tests.js:

if (typeof MochaWeb != 'undefined') {
 MochaWeb.testOnly(function () {

   describe('Friends are added successfully', function () {

     it('Should add a new person to the Friend collection', function(done) {
       var friendId = Friends.insert(
           { firstName: 'New',
           lastName: 'Friend'});

       var friend = Friends.findOne({'firstName':'New'});
       console.log(friend);
       chai.assert.equal(friend.length === 1);
       done();
     });
   });
  })
;}

My problem is that when I run either the meteor command or meteor --test, I get nothing in the terminal apart from the expected:

=> Started proxy.                             
=> Started MongoDB.I20150115-22:31:03.216(0)? [velocity] chokadir watching /correctDirectory/tests
=> Started your app.

=> App running at: http://localhost:3000/

But then Velocity just hangs (a blue circle with a wider blue ring around it - no greens or red), pulsating and not providing any feedback whatsoever. None on the developer console or the terminal either! I tried checking localhost:5000 but this comes back as 'not available'.

Not sure how to start with figuring this one out!

Thanks in advance to anyone who can help :)


Solution

  • I was able to get your example to work on my local, so I would recommend checking versions of your software and get that in line first.

    Here are a few things you can check, but I'll show what's on my machine for comparison:

    • Check your version of node

      node -v

      v0.10.35

    • If necessary, upgrade node. On my mac, I do the following:

      brew update && brew upgrade node

      If you don't have a mac, you might want to google for upgrade instructions for your machine's platform.

    • Check your package versions

      meteor list

      meteor-platform 1.2.1

      mike:mocha 0.5.1

      velocity:core 0.4.5

    • Check your meteor version

      meteor --version

      Meteor 1.0.2.1

    • If necessary, upgrade meteor and related packages

      meteor update

    If none of that helps, please post additional information. Additionally, you can also create an issue on Github for Velocity.