generator-webapp icon indicating copy to clipboard operation
generator-webapp copied to clipboard

Mocha unit testing with PhantomJS

Open sindresorhus opened this issue 10 years ago • 12 comments

https://github.com/mrhooray/gulp-mocha-phantomjs

sindresorhus avatar May 10 '14 21:05 sindresorhus

I tried, but didn't manage to get it working. How about Karma?

silvenon avatar Jun 02 '14 00:06 silvenon

Not a big fan, but I don't like Mocha either, so why not.

sindresorhus avatar Jun 03 '14 09:06 sindresorhus

What's wrong with Mocha? I don't mind Karma being used either.

addyosmani avatar Jun 03 '14 09:06 addyosmani

@addyosmani probably mostly personal preference, but; it's bloated, slow, introduces implicit globals, awful programmatic API, too short default timeout, too much boilerplate to use it on the client-side, and probably more I can't remember right now.

sindresorhus avatar Jun 03 '14 09:06 sindresorhus

@sindresorhus Which one do you use? I had bad experience with Mocha also, so I switched to Jasmine + Karma. I can implement that combo if that works for you guys.

silvenon avatar Jun 03 '14 10:06 silvenon

Mocha

sindresorhus avatar Jun 03 '14 10:06 sindresorhus

:)

kevva avatar Jun 03 '14 13:06 kevva

I tried, but didn't manage to get it working. How about Karma?

Just tried to integrate it and it's a PITA. I'm also +1 for Mocha though.

arthurvr avatar Apr 06 '15 12:04 arthurvr

:+1: Mocha.

addyosmani avatar Apr 06 '15 12:04 addyosmani

What do you guys think about this kind of setup for testing with PhantomJS & Mocha? Users would be able to easily switch browsers or use external services like Sauce Labs, Browerstack etc. Or is it a tad too opinionated?

silvenon avatar Jun 01 '15 00:06 silvenon

I was also unable to get gulp-mocha-phantomjs to work. I raised this https://github.com/mrhooray/gulp-mocha-phantomjs/issues/47 issue. This plugin seems easier to use than Karma, although Karma does provide code coverage too as an added bonus.

RehanSaeed avatar Sep 14 '15 10:09 RehanSaeed

WebdriverIO is a great Nodey way to test, so that's probably the right way to go. I'm already quite experienced with it, I'm just waiting for it to release a public API for plugins.

silvenon avatar Sep 14 '15 13:09 silvenon