Showing how to unit test SailsJS
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
api
assets
config
test
views
.gitignore
.jshintrc
Gruntfile.js
LICENSE
README.md
app.js
package.json

README.md

Unit testing SailsJS

##Setting up testing environment This tutorial shows you how to get your testing environment setup. It also goes through how to run your first SailsJS unit test Sails with Mocha and how to generate code coverage with Istanbul:
http://blog.sergiocruz.me/unit-test-sailsjs-with-mocha-and-instanbul-for-code-coverage

##What are SailsJS Services and how to use them The SailsJS documentation does not seem to cover services much... that's why I put a simple guide together explaining what SailsJS Services are and how to use them:
http://blog.sergiocruz.me/sailsjs-services-how-to-use-them-in-your-controllers

##How to mock services in your controller Mocking services in SailsJS is actually pretty simple once you get the hang of it. The problem is actually getting to the point where you get the hang of it. That's exactly why I wrote up a tutorial on how to mock services when testing your controllers:
http://blog.sergiocruz.me/unit-testing-sails-js-how-to-mock-sailsjs-services-in-controllers