Maybe someone met any npm module/tutorial/guide/article about "how to test nodejs application using mocha, gruntjs?" Would be glad to any suggestions.

有帮助吗?

解决方案

I'd recommend the following (it worked for me):

  1. Install Grunt and get your first sample grunt task running based on the Grunt documentation
  2. Use this grunt task to get server-side Grunt running Mocha tests for you, and this one for client-side tests. From the command line, you can just run $ grunt to watch the results pop up.
  3. At this point, you can check out Mocha interfaces for samples of how your tests can look. Note that there's also should.js, if you're big on rSpec-style tests. Once you've settled on an interface, more Googling/StackOverflowing is the best way to proceed (e.g. Google "Mocha should.js examples").
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top