-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Update and improve the documentation on Testing #7307
Comments
@alex-marquette Thanks for posting! We'll take a look as soon as possible. In the mean time, there are a few ways you can help speed things along:
Please remember: never post in a public forum if you believe you've found a genuine security vulnerability. Instead, disclose it responsibly. For help with questions about Sails, click here. |
Thanks for the suggestion/feedback @alex-marquette, I'll bring this up with the team when we meet next. |
@eashaw can i work on it? |
@vr-varad Of course! We're always happy to take a look at PRs that improve the Sails documentation. |
Node version:
Sails version (sails):
ORM hook version (sails-hook-orm):
Sockets hook version (sails-hook-sockets):
Organics hook version (sails-hook-organics):
Grunt hook version (sails-hook-grunt):
Uploads hook version (sails-hook-uploads):
DB adapter & version (e.g. [email protected]):
Skipper adapter & version (e.g. [email protected]):
Basically, the title. After going through the course on Platzi, looking at the Ration.io source code and the official documentation I don't think I ever really had a decent testing setup run the way it probably was expected to for this framework. The closest I got was following this blog by Kevin, https://blog.sailscasts.com/testing-sails-applications-with-mocha-and-supertest and that blog post is for a Sails JS API with no front-end option set.
Looking specifically at the official documentation on the website, if you need to test with a front-end there's no mention of disabling the CSRF in the test environment or creating a fake endpoint to get a cookie and the CSRF as shown in the ration.io source code. So if you are brand new, you can end up with 403 or 401 on a 200 request because of not having a cookie or the CSRF token present both of which aren't mentioned in the official documentation on the website. There are also a lot of baked assumptions in the documentation themselves which can make it hard for anyone starting out with the framework to figure out what is really happening behind the scenes in the testing environment. At bare minimum the documentation should be able to provide a developer with a simple setup and be able to handle authenticating a user and doing something with that authenticated user (like viewing a restricted page) if they have the front-end generated for the application.
The text was updated successfully, but these errors were encountered: