Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eager loading of tests does not work as described in the Meteor guide #99

Closed
derwaldgeist opened this issue Mar 31, 2020 · 2 comments
Closed

Comments

@derwaldgeist
Copy link

derwaldgeist commented Mar 31, 2020

I am on a Meteor 1.8 app and tried to add mocha tests to it. My strategy would be based on eager loading, i.e. I want to place tests inside the imports folder, alongside the respective tested code, and I would love to have these tests run automatically, without having to reference them in a master spec file.

However, eager loading does not work as described in the Meteor guide. Even if I add the .spec.js extension to a test file, it won't be executed.

I found this similar issue #78 and noticed that I also had specified the mainModule and testModule values in package.json like this:

  "meteor": {
    "mainModule": {
      "client": "client/main.js",
      "server": "server/main.js"
    },
    "testModule": "tests/main.js"
  },

So I first tried to remove the testModule entry, but this did not work either. Then I removed the whole meteor section, but it still does not work. How is it actually possible to use eager loading for test files?

(If I specify testModule and manually reference a spec from tests/main.js, it works, but this would be pretty cumbersome.)

@SimonSimCity
Copy link
Member

Loading of files (if eager or not) is part of the Meteor framework, not of this package. This yields for testing files as well as for files which are part of your application.

I don't want to shut you off here, but this problem is nothing which could be solved as part of this package.

I can have a look at your project if you're willing to upload a project to GitHub which describes the problem in a minimal configuration - but only if you're then willing to update the documentation of either this package or the Meteor Guide. Mainly because they (to me) are quite clear - but it's always harder to explain something if you (as the writer) have the full picture and some concepts, which others aren't familiar with, are obvious to you.

@derwaldgeist
Copy link
Author

Ok, thanks for the feedback. I also assume it's a problem in Meteor itself, or the Meteor guide is just incorrect.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants