has anyone else experienced that using meteor test * tests simetimes simply don’t show up in the testrunner, when hidden erros occur?
I am running my tests from within imports/modules/* and right now a lot of tests do not show up.
I am sure that I have an error somewhere in my code BUT I would still expect the testrunner to run all tests.
Update. I have found the reason for the tests NOT showing up.
The Scenario:
Out of 65 client tests ONLY 21 where showing up.
The browser-console showed a couldn't import module xxxx-error within an anonynous function call, so I could NOT see which line of code this was related to
There was NO OTHER error message shown in the browser, indicating that I was having a problem. It seems like the testrunner just stopped.
In my case I just had 21 passing tests and was NOT really awaire (for quite some time) that the other 44 were NOT running. This is really bad - the testrunner should ALWAYS show that something went wrong with the other tests.
The reason for the testrunner failing me trying to import a server file from the client.
The remaining question is: will there be a fix for the testrunner ALWAYS showing ALL tests?
I want to second this, this is a very challenging bug as it has a cascading effect in alphabetical order on your test cases. If you have a test that starts M (monkies.test.js) that throws a “cannot find module” error. tests starting with A-L will execute but any tests starting with M-Z will not run, without any sort of error.
Right now you really have to pay close attention to this as you might just loose your tests when commiting to version-control and later wonder what has happened.
A quick fix for the testrunner might be to simply count the number of “describe > it” in all test.js-files and the diff the number to the actual number of recieved test results. if it diffs then it should give an warning like “warning: we expected to recieve 22 test-results but just got 10”.
I’m making the assumption here that all of you are using pm mocha as your testrunner. I had very similar issues though mine were limited to server-side testing.
I developed a simple test case using the todos app and reported my issue on PM Mocha’s gethub site. I was pleasantly surprised at the quickness with which @jsep verified the issue and created a fix.
I would suggest you try the version of PM Mocha with that fix,
meteor add practicalmeteor:mocha@2.4.6-rc.2
and if that does not resolve your issue, figure out a simple change that can be made to the latest version of todos to recreate the problem and report it to the PM Mocha site as I did. My guess is you’ll be pleased with the result.
I’m using 2.4.5_2 on my boilerplate code it works well until you add the dispatch:mocha-phantomjs package and the server side tests stop working. I opened up a bug on dispatch:mocha-phantomjs and it is closed in favor of https://github.com/practicalmeteor/meteor-mocha/issues/23