Unable to run spec of my package



I’m currently trying to restructure the package so that it can run with apm’s test script.

I’ve converted my folder to lib and created a spec file.

when trying to atom.packages.activatePackage('autocomplete-modules') (autocomplete-modules being the developed package) it fails to obtain it.

as atom.packages.getActivePackage('autocomplete-modules') is undefined.

When I look at the source i don’t see my lib folder!


I believe its something to do with the activationHooks…but i’m not sure how to get it working.

Here’s the repo: https://github.com/jonyeezs/atom-autocomplete-modules/tree/refactor

Any guidance would be appreciated!


What happens if you omit activationHooks so that the package activates automatically?


It does get activated. So must be the activationHooks.


You probably don’t need that behavior. autocomplete-plus already allows your package to limit the scopes to which it applies. activationHooks and activationCommands are for when you have a big package that you don’t want Atom to activate immediately because it could slow down startup.


good point, I’ll see if i can do without it. thanks!



thanks for your help. It did work when i removed activationHook.

Any chance of explaining how to get a spec working if it did have activationHook?


The test runner appears to need for the package to be loaded before it can run tests. This makes sense to me, and I don’t know of a way around that.