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

倾然丶 夕夏残阳落幕 提交于 2019-12-05 22:02:18

问题


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


回答1:


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.




回答2:


Check out wolfpack. It's a SailsJS model-testing library that allows you to test Sails models without the need for a db or lifting your sails app.



来源:https://stackoverflow.com/questions/17579435/is-it-possible-to-use-the-mocha-framework-against-a-model-in-sails-js

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!