質問

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