ember-cli / ember-cli

The Ember.js command line utility.
https://cli.emberjs.com
MIT License
3.26k stars 1.16k forks source link

Test framework should be pluggable. #437

Closed jimsynz closed 10 years ago

jimsynz commented 10 years ago

It should be possible to switch out qunit for mocha or other test framework and have the generators switch over and bring in any oter deps needed for the framework (sinon, chai, chai-as-promised, etc). Perhaps these customisations away from the tomhuda stack should be external projects, but we need to be able to accommodate these changes in ember-cli.

rwjblue commented 10 years ago

I believe that this is completely customizable now, it just is not well documented. Sounds like a wonderful blog post...

You could use broccoli-file-remover to remove the qunit files from the tree generated by EmberApp.toTree or you could overwrite the testFiles function to spit out whatever files you need/want. The tree returned from EmberApp.toTree is completely customizable as is the tests/index.html.

stefanpenner commented 10 years ago

we will support qunit, and enable addon support for w/e you wish.

MajorBreakfast commented 10 years ago

I'd like to chime in here: After having used mocha now in serveral server projects I've really grown to like it. Yes it should be an addon, but I think once we have mocha support we should even consider making it the default testing framework for new projects. Qunit really feels super ancient.

WMeldon commented 10 years ago

@MajorBreakfast I'm personally agree with you, but QUnit has undeniable momentum in the Ember community. Ember's tests are written in QUnit so it's easier to be confident that things will "just work". It's a hard sell as the default

Once ember-qunit has been better converted for mocha (https://github.com/rpflorence/ember-qunit/pull/44 maybe?), ember-mocha-adapter will need a couple small tweaks and Mocha should be as easy to get working as QUnit.

MajorBreakfast commented 10 years ago

@WMeldon Jep, I agree that having this discussion will be much easier once our mocha solution shines. :) But it's definitly worth putting some effort into. :P