Sails.js hooks #298

chrisns opened this Issue Oct 19, 2015 · 5 comments


None yet

2 participants

chrisns commented Oct 19, 2015

Sails allows you to have installable hooks that you you simply npm install and because the package.json of that has a flag in it, "sails": {"isHook": true} sails automagically loads it for you.

Using your repo
if you npm install sails-controller-driven-routing

In mocha it'll load the index.js and enter the initialize()

With wallaby however thanks to how it instruments and caches things it doesn't appear to allow that.

Any advice on how it can be tweaked?




I'm not an expert in sails.js, but when I run mocha in the sample repo that you have mentioned, it doesn't load index.js of the installed sails-controller-driven-routing. Perhaps I'm doing something wrong. Could you please create a smaller repo or a pull request to the mentioned repo where I could reproduce the issue?

chrisns commented Oct 19, 2015

ah, sorry, didn't realise that your demo had an older version of sails in it
have made changes to this fork which should demonstrate the issue:


Thanks. I had a look and created the pull request with wallaby config addition that should do the trick.

An alternative to the config change would be to just specify node modules with hooks in your files list (but only node modules with hooks, as copying all node modules over to wallaby cache is an overkill).

You may pick whichever solution you like better. Please let me know if it works for you.

chrisns commented Oct 20, 2015

amazing, your support is as always incredible!
definitely the best value software licence I own.


@chrisns Thanks for your support!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment