yeoman / generator-webapp

A gulp.js generator for modern webapps
3.77k stars 709 forks source link

Mocha unit testing with PhantomJS #120

Open sindresorhus opened 10 years ago

sindresorhus commented 10 years ago

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

silvenon commented 10 years ago

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

sindresorhus commented 10 years ago

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

addyosmani commented 10 years ago

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

sindresorhus commented 10 years ago

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

silvenon commented 10 years ago

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

sindresorhus commented 10 years ago

Mocha

kevva commented 10 years ago

:)

arthurvr commented 9 years ago

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.

addyosmani commented 9 years ago

:+1: Mocha.

silvenon commented 9 years ago

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?

RehanSaeed commented 9 years ago

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.

silvenon commented 9 years ago

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.