Skip to content

Latest commit

 

History

History
13 lines (10 loc) · 1.02 KB

README.md

File metadata and controls

13 lines (10 loc) · 1.02 KB

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