Using Chimp for Integration Testing


#1

I have a number of E2E tests running via Chimp and a fair few unit tests via Mocha (outside of Meteor, stubbing Meteor imports with proxyquire). All is good.

However, I now want to add some integration tests. If I follow the Meteor Guide then I’m installing practicalmeteor:mocha, having another test command and having to spin up another instance of Meteor. That means I’m running 3 instances for dev / integration and e2e tests.

I was wondering why I can’t just run my tests within a chimp server block e.g.

server.execute(() => {
  // Do some tests in the Meteor context
});

Is anyone doing this?


#2

You can do this for sure. I would be nice to extend the Mocha interface to use some syntax sugar like this:

it('should do x').onServer(() => {
  
});

It would make it ready a little nicer that’s all though, otherwise it’s the same solution you’re suggesting.