Atom.packages.resolvePackagePath('package-name')` undefined in travis and appveyor but not locally


I’m using the package’s own folder as file area for some caching stuff and I wrote an integration tests that uses it. atom.packages.resolvePackagePath('package-name') however returns undefined on travis and appveyor. It works locally however. Shouldn’t this work?


It probably should, though I suppose that depends on why exactly it isn’t working.


Are you calling that function with your testing package name or some other third party package?


@jerone My own package name.


It was a race condition. I used a require clause at the top of my test that made the resolvePackagePath be called at load. This somehow worked when running locally with:

apm test or atom --dev --test spec-integration but failed on all ci environments. This change made it work there too:

PR with links to CI:

I guess the weird thing is why it worked locally. Is atom + plugins already loaded before tests run? Most package tests seem to wait for package activation…?