문제

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