0

The meteor packages cannot be imported without starting meteor (or meteor test). A.k.a. the following won't work.

import { Template } from 'meteor/templating';

Is there a way for this to work? My specific example is by running tests without the standard Meteor test commands, because I don't want to spin up all of Meteor (or a major subset of it) just to run tests that require its modules. Alternatively, is there a way to see if this is on the radar for the Meteor Development Group? Is there a way to build this or shim it or somehow get it working?

Jag
  • 1,840
  • 1
  • 17
  • 25
  • You can do dependency injection and inject mocks for tests you expect to run independently, but I doubt that this is what you are looking for. You can also isolate some of the code such that is does not depend on meteor and test that. Meteor imports sometimes have different semantics depending on the the runtime environment (client or server), so it won't be imported the same way as standard npm packages are. – MasterAM Oct 14 '16 at 07:32
  • You're correct in your assumption. There are cases where mocks will work for me, but others where it won't. It's those cases I'd like to address. – Jag Oct 14 '16 at 08:20

0 Answers0