New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sails.js hooks #298

Closed
chrisns opened this Issue Oct 19, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@chrisns

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 https://github.com/wallabyjs/sailsjs-mocha-testing-barrels-fixtures-example 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?

Thanks

Chris

@ArtemGovorov

This comment has been minimized.

Show comment
Hide comment
@ArtemGovorov

ArtemGovorov Oct 19, 2015

Member

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?

Member

ArtemGovorov commented Oct 19, 2015

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

This comment has been minimized.

Show comment
Hide comment
@chrisns

chrisns 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:
https://github.com/chrisns/sailsjs-mocha-testing-barrels-fixtures-example
thanks!

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:
https://github.com/chrisns/sailsjs-mocha-testing-barrels-fixtures-example
thanks!

@ArtemGovorov

This comment has been minimized.

Show comment
Hide comment
@ArtemGovorov

ArtemGovorov Oct 20, 2015

Member

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.

Member

ArtemGovorov commented Oct 20, 2015

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

This comment has been minimized.

Show comment
Hide comment
@chrisns

chrisns Oct 20, 2015

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

chrisns commented Oct 20, 2015

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

@ArtemGovorov

This comment has been minimized.

Show comment
Hide comment
@ArtemGovorov

ArtemGovorov Oct 20, 2015

Member

@chrisns Thanks for your support!

Member

ArtemGovorov commented Oct 20, 2015

@chrisns Thanks for your support!

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