Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to use the Mocha Framework against a model in Sails.js?

Sails.js uses the MVC pattern for Node.js and I was wondering if Mocha could be hooked up for testing Models.

like image 982
Todd Avatar asked Jul 10 '13 19:07

Todd


People also ask

What is Mocha framework used for?

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.

Is sails js framework?

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.

What is the use of sails js?

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.


1 Answers

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.

like image 119
Matthew Bakaitis Avatar answered Oct 02 '22 13:10

Matthew Bakaitis