Solved: Testing package with local dependencies


#1

I’m trying to run the tests of dalgard:jade with the local version of its dependency, dalgard:jade-compiler, but I can’t find anywhere to put a packages folder that will make the former package import the latter from anywhere but Atmosphere.

Any hints?


#2

Hi,

I can’t figure out what you exactly wanted to do.
Would you like to force a specific package version to be used ?
Or would like to use a package that is not on Atmosphere ?

Best,
Yann


#3

dalgard:jade has a dependency, namely dalgard:jade-compiler. When running the tests of dalgard:jade, it imports dalgard:jade-compiler from Atmosphere.

Instead, I want to use a local copy of dalgard:jade-compiler.

Without this possibility, I can’t edit dalgard:jade-compiler and run the tests of dalgard:jade against the changes, without first pushing the edits to Atmosphere (not an option).


#4

If your dalgard:jade-compiler package is in your packages folder then it will use.
Think to update the package version number to be sure you will use the one you currently edit from within your project.

If you want to reference a package from another project then check https://github.com/DispatchMe/mgp
It enables you to add a dependency to a private package from your github.

Hope this help.

Best,
Yann


#5

Thanks, but I’m talking about when I test the package with meteor test-packages ./.

I suppose it might help if I do it in the context of a project, hmm… But it’s not very practical having to create a new project, when a package can be tested alone with .../mypackage$ meteor test-packages ./.


#6

Try

export PACKAGE_DIRS="/path/to/your/custom/packages/folder

and put the dalgard:jade-compiler package in the dir above


#7

@sam: Sounds right, but won’t that prevent importing any package that aren’t in that directory?


#8

I think it just means it will try there first, then it will try atmosphere for the rest


#9

Ok, so your dalgard:jade-compiler is in project packages alongside with dalgard:jade right ?

If you change the version number in package.js of dalgard:jade-compiler and force to use this version number in dalgard:jade/package.js it should work.

api.onUse( [
   'dalgard:jade-compiler@LATEST_VERSION'
  ]);

#10

That’s right.

Well, that method hasn’t worked before, though – but come to think about it, I may have forgotten the equals sign in front of the version number.


#11

These solutions both work for testing the local version of a dependency:

  • Using PACKAGE_DIRS (for testing a package that isn’t inside a project)
  • Writing the meteor test-packages command inside a project

Thanks for your help!