practicalmeteor / meteor-mocha

Depreciated - Write meteor package tests with mocha and run them in the browser or from the command line with spacejam.
https://atmospherejs.com/practicalmeteor/mocha
Other
41 stars 13 forks source link

Client and server app tests run at the same time? #84

Open reywood opened 7 years ago

reywood commented 7 years ago

It appears that client app tests and server app tests are run simultaneously. This makes it really hard to run client and servers app tests that need to do some database setup beforehand. I've created a simple meteor app that demonstrates the simultaneous running of tests.

https://github.com/reywood/practicalmeteor-mocha-simultaneous-tests

nicklozon commented 7 years ago

Also curious about this. I'm not currently using Mocha for my Meteor projects, but a github user reported an issue and I noticed that he was using a beforeEach on tests and the client test was wiping out the server data: https://github.com/nicklozon/meteor-collection-revisions/issues/2#issuecomment-302268660

ArnieGA commented 7 years ago

In Meteor just use Meteor.isClient | Meteor.isServer and that'll separate the concerns.

reywood commented 7 years ago

@ArnieGA That will not fix this problem.

ArnieGA commented 7 years ago

Ugh! My fault...didn't realize your issue was related to the need of setting up some stuff before running the tests and not the client/server test code running at the same time.

hems commented 6 years ago

On my case i currently:

If i write server tests, they will run simultaneously but i wish the server tests to run after the client tests so I can check if notifications for other users were created, etcs.