Docs and tutorial should be updated for running `meteor test ...`


#1

I’m new to Meteor, so I wasn’t sure how to bring attention to this, but the tutorial was giving me no end of trouble in the testing section, because running the meteor test --driver-package meteortesting:mocha command does the exact opposite of what the docs claim: it only runs tests in the test/ directory, and none of the *.test[s].js files. After being a confused for a while, I noticed that package.json contains a ‘testModule’ attribute which is set to ‘test/main.js’, and upon deleting this, it worked. I did a little digging and this appears to be really recent. The tutorial (and other docs on testing, like this section) should probably be updated to reflect this and tell users to remove or edit this line in package.json in order to get the expected behavior.


Testing Meteor apps in 2018, a rant
#2

Good spotting! Thanks for bringing this up

You should post an issue in the guide repo: https://github.com/meteor/guide, and if you have time, consider a pull request to fix it :slight_smile:


#3

Thanks, and no problem!

I actually just created the pull request a short while ago; I didn’t realize the docs were all on Github until after I posted this. :slight_smile: It’s bot-approved and ready to go, so hopefully someone merges it in!


#4

Ditto! Been wracking my brain trying to figure this out. Also new to Meteor, and stumbled upon the same “fix” - deleting the testModule stanza from package.json runs .test. files, but it then ignores tests in the /tests folder.


#5

It’s a tad frustrating that they still haven’t accepted my pull request to their docs (https://github.com/meteor/tutorials/pull/173), or any of the others that fix similarly annoying problems. I would understand if they just don’t have the time, but they should make that clear, or set some sort of schedule for how frequently they’ll review minor pull requests.


#6

Yeah it’s a bit frustrating that the tutorials haven’t had much love
recently. Especially when there’s serious issues plaguing them right now


#7

Is there a way to “push” more on this topic, just arrived today at the testing chapter of the tutorial and it was really annoying not finding any obvious explanation on this “testModule” option in the guide :sweat:.


#8

I fell in love with Meteor when I saw a couple of Tolinski videos, it’s really brilliant, and I decided that I’m going to give it a test/evaluation try for our new project. I’ve just arrived to learning Meteor Testing with my project, and I’ve joined the forum just to ask exactly this question of @collinr. I created my project with the new option meteor create --react, which created a /tests folder with main.js in it as well as a testModule directive in the meteor section in package.json. I love this simple and clean approach. I have found a very nice and detailed documentation of this new feature in 1.8 “Support a meteor.testModule section in application package.json files”. The 1.8 changelog has a short section about testModule, too.


#9

At least I loosed only half an hour ! :sweat:


#10

I have also just spent +3 hours trying to figure this one out as well. Is there anything that still needs to be done to get the mentioned PR merged?