grunt-mocha
grunt-mocha copied to clipboard
Use mocha-phantomjs for phantomjs implementation
Output would allow for CI integration (#45) and way more reporters/flexibility. Need to look into how easy it would be to wrap in a task.
mocha-phantomjs only supports running 1 test html/url at a time so you would need to take this into consideration. One feature that I like about grunt-mocha that mocha-phantomjs lacks is the filtering out of console.log() messages from the tests themselves
@kmiyashiro I could take a look at this if you'd like. From an example on pastebin I don't think it would be too difficult to implement/integrate with this plugin.
Hi, I'm experimenting with both right now. I have both mocha-phantomjs + grunt-mocha-phantomjs working and I also have grunt tasks to run the same tests via grunt-mocha.
Maybe I'm missing something but what is mocha-phantomjs bringing to the table that the current implementation here lacks? I have setup a CI job within Jenkins using the Tap reporter output and it seems to run just fine. The task to execute it is just something like grunt mocha:jenkins >> target\test-results.tap and I specify tap as the reporter in the grunt config. What else would mocha-phantomjs buy me?
Sorry for the questions, but I'm trying to navigate through the sea of many different options.
how does the tap reporter work for you? https://github.com/kmiyashiro/grunt-mocha/issues/55 i couldn't get that to work
Any update on Jenkins integration or code coverage functionality?
@FoxGit What are you looking for in terms of Jenkins integration? It fails Jenkins builds just fine, are you looking for pretty output? I have not even looked into code coverage yet.
Indeed, my bad. Jenkins integration running the tests with phantomjs works just fine. Code coverage capabilities would be most appreciated however. Then you can run your tests in a browser, headless with PhantomJS on the Jenkins AND have a coverage report with one single plugin, that would be awesome!
@foxgit @kmiyashiro There are other tools for code-coverage like mocha-cov or Istanbul-mocha. Coverage reporting is probably a separate responsibility from running the specs. On Jun 20, 2013 2:48 AM, "FoxGit" [email protected] wrote:
Indeed, my bad. Jenkins integration running the tests with phantomjs works just fine. Code coverage capabilities would be most appreciated however. Then you can run your tests in a browser, headless with PhantomJS on the Jenkins AND have a coverage report with one single plugin, that would be awesome!
— Reply to this email directly or view it on GitHubhttps://github.com/kmiyashiro/grunt-mocha/issues/51#issuecomment-19735716 .
I don't think it's a seperate thing. Writing unit tests without knowing about the coverage sounds not right. However there are alternatives of course, I use grunt-mocha-test right know. But as I already use this plug-in an additional coverage feature would be nice to have. :)
For anyone interested in code coverage enforcement for use with CI systems like Travis and Jenkins, see my comment in issue https://github.com/kmiyashiro/grunt-mocha/issues/44#issuecomment-21898374