Sails.js uses the MVC pattern for Node.js and I was wondering if Mocha could be hooked up for testing Models.
Mocha is an open-source JavaScript-based test framework that helps you write better-quality code by running your automated tests in Node. It offers out-of-the-box features such as creating descriptive automated tests, robust reports, and even executing your tests whenever any files are changed locally.
js (or Sails) is a model–view–controller (MVC) web application framework developed atop the Node. js environment, released as free and open-source software under the MIT License. It is designed to make it easy to build custom, enterprise-grade Node. js web applications and APIs.
Sails is the most popular MVC framework for Node. js, designed to emulate the familiar MVC pattern of frameworks like Ruby on Rails, but with support for the requirements of modern apps: data-driven APIs with a scalable, service-oriented architecture.
I know you asked this awhile ago, but I was searching around myself and there's not much out there at the moment. I figured I'd drop what I found into this answer...
I found some discussion on the sails github and a gist with some example code.
There is also a second discussion with more examples.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With