meteormocha.jsmeteor-velocity

How to check velocity is using mirrored data in meteor with mocha


I am using velocity + mocha for testing my meteor app. On client side when I run test case like below, it is passing.

describe("categories server", function(){

  it("should return categories", function(done){

    setTimeout(done,1500);
    chai.assert(Cats.find({}).count() > 0);
    this.timeout(1500);
  });    

But on Client side I'm getting blank collection for the similar test.And in mocha iframe all fields dependent on db are empty. Please any help is much appriciated. I'm new in testing.


Solution

    1. Execute meteor mongo to get into the MongoDB shell of your app.
    2. Execute use mocha in the MongoDB shell to switch to the database that the Mocha mirror uses.
    3. Validate the contents of your database with something like: db.cats.find().pretty().