grunt-mocha icon indicating copy to clipboard operation
grunt-mocha copied to clipboard

Use mocha-phantomjs for phantomjs implementation

Open kmiyashiro opened this issue 12 years ago • 10 comments

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.

kmiyashiro avatar Mar 08 '13 19:03 kmiyashiro

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

imawuman avatar Mar 16 '13 04:03 imawuman

@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.

jackcviers avatar Mar 22 '13 23:03 jackcviers

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.

davisford avatar Apr 16 '13 15:04 davisford

how does the tap reporter work for you? https://github.com/kmiyashiro/grunt-mocha/issues/55 i couldn't get that to work

imawuman avatar Apr 17 '13 03:04 imawuman

Any update on Jenkins integration or code coverage functionality?

FoxGit avatar Jun 19 '13 13:06 FoxGit

@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.

kmiyashiro avatar Jun 19 '13 17:06 kmiyashiro

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 avatar Jun 20 '13 07:06 FoxGit

@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 .

jackcviers avatar Jun 20 '13 16:06 jackcviers

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. :)

FoxGit avatar Jun 21 '13 07:06 FoxGit

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

geekdave avatar Jul 31 '13 21:07 geekdave