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

Dependency on jquery? #98

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

Dependency on jquery? #98

derwaldgeist opened this issue Mar 31, 2020 · 6 comments

Comments

@derwaldgeist
Copy link

I am new to this package and tried to activate it as described in the Meteor guide and the docs. However, I get an error in the browser console:

modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:609 Uncaught Error: Cannot find package "jquery". Try "meteor add jquery".
    at fallback (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:609)
    at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:254)
    at Module.moduleLink [as link] (modules.js?hash=b16e0d891f40b752fb0d354bc21c99af16b3f2f2:316)
    at methods.js (methods.js:1)
    at fileEvaluate (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:346)
    at Module.require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:248)
    at require (modules-runtime.js?hash=d3c3e5d67c95f97a60888bda7373292efad3be5e:268)
    at lmieulet_meteor-coverage.js?hash=1d48273b7dd15a2c52d3ca3914a49eae979cbd1f:193
    at lmieulet_meteor-coverage.js?hash=1d48273b7dd15a2c52d3ca3914a49eae979cbd1f:198

Looks as if this package requires the jquery package, but does not state this in the package.js file. I don't have jquery in my app (and don't want it either), as my app is solely based on React.

@derwaldgeist
Copy link
Author

I have resolved this by adding --extra-packages jquery to the command line in testing mode. But tis may still have an unwanted impact on my app. So I would prefer a version of this package where jquery is not mandatory.

@SimonSimCity
Copy link
Member

SimonSimCity commented Mar 31, 2020

Your stack trace references to the package lmieulet:meteor-coverage. Please check if you have the latest version of this package installed. I sent a PR to the author which removed the dependency on jQuery which he merged in. This is included since the second major release. Please update to the latest version which is compatible to your Meteor version: https://github.com/serut/meteor-coverage#compatibility

If you have no need for code coverage report, you can remove the package lmieulet:meteor-coverage from your project. The less dependencies your project has the better.

I'll close it here because it's unrelated to this package.

@derwaldgeist
Copy link
Author

Thanks for the fast response. Fun thing is, I just ran

meteor add meteortesting:mocha

and this installed the lmieulet:meteor-coverage package. I am running Meteor 1.8, maybe this is the case why outdated versions are being installed?

@derwaldgeist
Copy link
Author

derwaldgeist commented Mar 31, 2020

BTW: I placed a test under imports, with a .spec.js file ending, as suggested in the Meteor guide. But it won't be executed. What may be the cause of this? Both tests (client and server) report 0 passes, 0 fails.

Seems to be similar to the problem described in #78 and filed it as a new issue #99.

@SimonSimCity
Copy link
Member

I'll try to answer your questions one by one even though they're not related to this issue:

I am running Meteor 1.8, maybe this is the case why outdated versions are being installed?

That's because of the way Meteor installs packages and their dependencies. On the Meteor Guide it states:

Note that the version solver also has a concept of “gravity” - when many solutions are possible for a certain set of dependencies, it always selects the oldest possible version.

Source: https://guide.meteor.com/writing-atmosphere-packages.html#version-constraints

Now your second question - which is related to importing of files:

This package only runs tests, it doesn't import any file. Importing files is the responsibility of the Meteor framework. You'd have this problem also with any other test runner.

If you have more questions please use the Meteor Community Slack channel: https://meteor-community.slack.com/

@SimonSimCity
Copy link
Member

Published new version v2.0.0 of this package which does not include the package for code-coverage anymore. If you need it, you'll have to add it manually. This way the system will always install the latest version possible at the time you're installing it.

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