Closed derwaldgeist closed 4 years ago
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.
Ok, thanks for the feedback. I also assume it's a problem in Meteor itself, or the Meteor guide is just incorrect.
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
andtestModule
values inpackage.json
like this:So I first tried to remove the
testModule
entry, but this did not work either. Then I removed the wholemeteor
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 fromtests/main.js
, it works, but this would be pretty cumbersome.)